[
https://issues.apache.org/jira/browse/LOG4J2-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17281919#comment-17281919
]
Liviu Carausu edited comment on LOG4J2-3017 at 2/9/21, 5:55 PM:
----------------------------------------------------------------
if we do something like this:
{code:java}
String helloMessage = "HelloWorld " + someclass;
logger.info(helloMessage);{code}
the toString() method of SomeClass will be called only once
if we use the $ notation,
{code:java}
String helloMessage = "HelloWorld $someclass";
logger.info(helloMessage);{code}
the toString() method will be called 13 times for this example and it is
variable depending of the numbers of characters of the toString() method ...of
SomeClass
For classes with big toString() implementations we had over 30 seconds for such
a log call
was (Author: cliviu):
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)