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:11:53 UTC

LOG4J2-454: TimeBasedTriggeringPolicy should use event time millis

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


In the TimeBasedTriggeringPolicy.java, it's using system current timestamp
to compare with nextRollover time:
Code:
final long now = *System.currentTimeMillis();*
if (now > nextRollover) { ... ....

But I think, it should use the event time millis:
Code:
final long now = *event.getMillis();*
if (now > nextRollover) {... ...

According the event time millis, it can be System.currentTimeMillis or
Message's timestamp if the message implements TimestampMessage.

So I think the event.getMillis() would be the best choice for comparing
with nextRollover time.