If I use an AsyncAppender to log a message object that is changed after the call of the logging method, the logging will sometime show up the value changed afterwards. Example StringBuffer buffer = new StringBuffer("Hello world"); Logger.getLogger("sample").debug(buffer); buffer.setLength(0); buffer.append("changed message"); If an AsyncAppender is used for logging this, it may log on of the three values: "Hello world" "" "changed message"
Committed test and fix in rev 587252. From reviewing the code, it appears that this bug has been in the log4j codebase for an extended time and was preserved (not introduced) in the AsyncAppender rewrite released in log4j 1.2.14. Added a call to getRenderedMessage() which will capture the value of the message object before placing the LoggingEvent on the queue.