[
https://issues.apache.org/jira/browse/LOG4J2-1628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15537413#comment-15537413
]
Remko Popma edited comment on LOG4J2-1628 at 10/1/16 12:08 AM:
---------------------------------------------------------------
Mark, the problem description of scrambled messages reminded me of LOG4J2-1583.
This was tracked down to the objects being logged themselves doing logging from
their {{toString()}} method, which didn't play well with some of the mechanisms
used to make Log4j garbage-free.
That issue has been fixed. Can you try if the problem still occurs with our
current master?
Another possible cause is that the AsyncLogger ringbuffer is full (could happen
if the application logs more than the appender can keep up with) and the
AsyncQueueFullPolicy is to log synchronously. This makes Log4j bypass the
AsyncLogger queue and send the event straight to the appender, so new and
previously queued events appear out of order in the log.
However, in Log4j 2.6.2 the default AsyncQueueFullPolicy only logs
synchronously when the queue is full and logging is attempted from an object's
{{toString()}} (to prevent deadlock). From 2.7 the default AsyncQueueFullPolicy
will be simplified (see LOG4J2-1518) but will have similar results.
was (Author: [email protected]):
Mark, the problem description of scrambled messages reminded me of LOG4J2-1583,
which was tracked down to the objects being logged themselves doing logging
from their {{toString()}} method, which didn't play well with some of the
mechanisms used to make Log4j garbage-free.
That issue has been fixed. Can you try if the problem still occurs with our
current master?
> File locking regression for Async FileAppender
> ----------------------------------------------
>
> Key: LOG4J2-1628
> URL: https://issues.apache.org/jira/browse/LOG4J2-1628
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.6.2
> Environment: centos
> Reporter: Mark Bowman
>
> We have several threads writing to an async file with locking set to true.
> Under log4j 2.5 the message from each thread are interleaved correctly. Using
> log4j 2.6.2 some messages are scrambled as if multiple threads are writing to
> the file simultaneously. Reverting to 2.5 fixes the problem.
> Configuration to follow.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]