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

Volkan Yazici commented on LOG4J2-3017:
---------------------------------------

My gut feeling is, the reason this problem doesn't surface with Logback is that 
Logback does only allow logging {{String}} values (hence {{GString}} gets 
immediately translated to a {{String}} at call site by Groovy), whereas Log4j 
tries to be smart and allows any object. While this intelligence pays off 
generously in terms of flexibility it provides, it doesn't help with broken 
disguises, e.g., {{GString}}.

What you can do is to define your own {{LogEventFactory}} or something – I am 
not really sure, I will check that out. Though given the amount of other Groovy 
users out there in the wild using Log4j, I am sitting on the fence whether we 
should expect our users to fix this or it should be us who is addressing this 
Groovy bug in Log4j on behalf of our users.

[~ggregory], [~ralphgoers], [~mattsicker], [~rpopma], any ideas?

> 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: Improvement
>            Reporter: Liviu Carausu
>            Assignee: Volkan Yazici
>            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