You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by 张涛 <ro...@gmail.com> on 2013/11/22 09:30:42 UTC

LOG4J2-455: RingBufferLogEvent should use Messsage timestamp first

https://issues.apache.org/jira/browse/LOG4J2-455

When AsyncLogger received log message (method public void log(final Marker
marker, final String fqcn, final Level level, final Message data,
final Throwable t)), currently it uses clock.currentTimeMillis() (see at
Line 221) as the timestamp.

But it should check the message implements TimestampMessage or not, if yes,
should use TimestampMessage.getTimestamp() as the timestamp, if not , then
using clock.currentTimeMillis().

The new Code:

*data instanceof TimestampMessage ? ((TimestampMessage) data
).getTimestamp() : clock.currentTimeMillis();*