logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "robin zhang tao (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LOG4J2-455) RingBufferLogEvent should use Messsage timestamp first
Date Sun, 22 Dec 2013 09:53:50 GMT

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

robin zhang tao updated LOG4J2-455:
-----------------------------------

    Description: 
When AsyncLogger received log message (method 
{code}
 public void log(final Marker marker, final String fqcn, final Level level, final Message
data,
            final Throwable t)
{code}
), currently it uses  
{code}
clock.currentTimeMillis()
{code}
 (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:
{code}
data instanceof TimestampMessage ? ((TimestampMessage) data ).getTimestamp() : clock.currentTimeMillis();
{code}


  was:
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();




> RingBufferLogEvent should use Messsage timestamp first
> ------------------------------------------------------
>
>                 Key: LOG4J2-455
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-455
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta9
>            Reporter: robin zhang tao
>
> When AsyncLogger received log message (method 
> {code}
>  public void log(final Marker marker, final String fqcn, final Level level, final Message
data,
>             final Throwable t)
> {code}
> ), currently it uses  
> {code}
> clock.currentTimeMillis()
> {code}
>  (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:
> {code}
> data instanceof TimestampMessage ? ((TimestampMessage) data ).getTimestamp() : clock.currentTimeMillis();
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
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