[
https://issues.apache.org/jira/browse/LOG4J2-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15240994#comment-15240994
]
Remko Popma commented on LOG4J2-1334:
-------------------------------------
AsyncAppender currently has some logic that checks the LogEvent implementation
class and drops the event if it is not either a {{Log4jLogEvent}} or a
{{RingBufferLogEvent}}.
I believe this is because the event is serialized/copied into a
{{Log4jLogEvent.LogEventProxy}} before passing it to the background thread.
LogEventProxy can only be created with a Log4jLogEvent, not any LogEvent.
I can't see any reason why the LogEventProxy could not be created with any
LogEvent and initialized via the getter methods... [~ralphgoers], am I missing
something?
> Add LogEventFactory that reuses a cached LogEvent for garbage-free
> synchronous logging
> --------------------------------------------------------------------------------------
>
> Key: LOG4J2-1334
> URL: https://issues.apache.org/jira/browse/LOG4J2-1334
> Project: Log4j 2
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.5
> Reporter: Remko Popma
> Assignee: Remko Popma
> Fix For: 2.6
>
>
> Until now I kept the scope of the garbage-free logging epic LOG4J2-1270
> limited to asynchronous logging with all loggers asynchronous. This seemed a
> natural thing to do since async loggers already have pre-allocated all
> LogEvent instances.
> Now that LOG4J2-1270 is nearing completion it looks as if the only thing that
> is required to allow synchronous logging to be garbage-free is a reusable
> LogEvent implementation, stored in a ThreadLocal. This ticket is to analyse
> and track the work for this option.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]