Author: rpopma
Date: Mon Dec 23 14:55:45 2013
New Revision: 1553122
URL: http://svn.apache.org/r1553122
Log:
Fix for LOG4J-455: RingBufferLogEvent should return Message timestamp for
TimestampMessages.
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
logging/log4j/log4j2/trunk/src/changes/changes.xml
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
URL:
http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java?rev=1553122&r1=1553121&r2=1553122&view=diff
==============================================================================
---
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
(original)
+++
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
Mon Dec 23 14:55:45 2013
@@ -27,6 +27,7 @@ import org.apache.logging.log4j.core.con
import org.apache.logging.log4j.core.lookup.StrSubstitutor;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.SimpleMessage;
+import org.apache.logging.log4j.message.TimestampMessage;
import com.lmax.disruptor.EventFactory;
@@ -180,6 +181,10 @@ public class RingBufferLogEvent implemen
@Override
public long getMillis() {
+ Message msg = getMessage();
+ if (msg instanceof TimestampMessage) { // LOG4J2-455
+ return ((TimestampMessage) msg).getTimestamp();
+ }
return currentTimeMillis;
}
Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1553122&r1=1553121&r2=1553122&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Mon Dec 23 14:55:45 2013
@@ -21,6 +21,9 @@
</properties>
<body>
<release version="2.0-RC1" date="2013-MM-DD" description="Bug fixes and
enhancements">
+ <action issue="LOG4J2-455" dev="rpopma" type="fix" due-to="Robin Zhang
Tao">
+ RingBufferLogEvent should return Message timestamp for
TimestampMessage messages.
+ </action>
<action issue="LOG4J2-477" dev="rpopma" type="fix" due-to="Tal Liron">
NPE in ClassLoaderContextSelector.
</action>