logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LOG4J2-454) TimeBasedTriggeringPolicy should use event time millis
Date Thu, 12 Dec 2013 02:15:08 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Remko Popma updated LOG4J2-454:
-------------------------------

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

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

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.


  was:
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.



Makes sense to me.

Team, any reason not to make this change?


> TimeBasedTriggeringPolicy should use event time millis
> ------------------------------------------------------
>
>                 Key: LOG4J2-454
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-454
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta9
>            Reporter: robin zhang tao
>
> In the TimeBasedTriggeringPolicy.java, it's using system current timestamp to compare
with nextRollover time:
> Code:
> {code}
>         final long now = System.currentTimeMillis();
>         if (now > nextRollover) { ... ....
> {code}
> But I think, it should use the event time millis: 
> Code:
> {code}
> 	final long now = event.getMillis();
> 	if (now > nextRollover) {... ...
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message