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 "Gary Gregory (JIRA)" <ji...@apache.org> on 2015/09/23 23:22:04 UTC
[jira] [Commented] (LOG4J2-1130) CsvLogEventLayout NanoTime
timestamp is always zero.
[ https://issues.apache.org/jira/browse/LOG4J2-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14905282#comment-14905282 ]
Gary Gregory commented on LOG4J2-1130:
--------------------------------------
Remko: thank you tracking this issue.
It feels like we need a more generic way to set this up, through the configuration file, because, what if I do not want to pay the cost of reading the nano clock on each log event for a given configuration and run?
> CsvLogEventLayout NanoTime timestamp is always zero.
> ----------------------------------------------------
>
> Key: LOG4J2-1130
> URL: https://issues.apache.org/jira/browse/LOG4J2-1130
> Project: Log4j 2
> Issue Type: Bug
> Components: Layouts
> Affects Versions: 2.4
> Reporter: Remko Popma
>
> CsvLogEventLayout generates NanoTime timestamps but these are always zero.
> To fix this, add the below code to the CsvLogEventLayout constructor:
> {code}
> // LOG4J2-1074 Switch to actual clock if nanosecond timestamps are required in config.
> // LoggerContext will notify known NanoClockFactory users that the configuration has changed.
> NanoClockFactory.setMode(NanoClockFactory.Mode.System);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org