[ 
https://issues.apache.org/jira/browse/LOG4J2-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17281919#comment-17281919
 ] 

Liviu Carausu commented on LOG4J2-3017:
---------------------------------------

if we do something like this:
String helloMessage = "HelloWorld " + someclass;
logger.info(helloMessage);
the toString() method of SomeClass will be called only once

if we use the $ notation,
String helloMessage = "HelloWorld $someclass";
logger.info(helloMessage);
the toString() method will be called 13 times and it depends of the numbers of 
characters of the toString() method ...

 

For classes with big toString() implementations we had over 30 seconds for such 
a log call

 

> Groovy logging of GString with $ notation is very slow
> ------------------------------------------------------
>
>                 Key: LOG4J2-3017
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3017
>             Project: Log4j 2
>          Issue Type: Question
>            Reporter: Liviu Carausu
>            Priority: Major
>         Attachments: SomeClass.groovy, TestLogging.groovy
>
>
>  
> Logging of GString is very slow.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to