[
https://issues.apache.org/jira/browse/LOG4J2-1074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614909#comment-14614909
]
Remko Popma commented on LOG4J2-1074:
-------------------------------------
It may impact performance (see my [previous
comment|https://issues.apache.org/jira/browse/LOG4J2-1074?focusedCommentId=14614440&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14614440]),
with people reporting between 30 nanos and some microseconds. Results
apparently vary a lot between platforms. I can measure on the platforms I have
access to but I expect the results will simply be somewhere in between these
extremes and whatever our measurements are, we still cannot guarantee that it
won't be slower on another platform.
This is why I
[propose|https://issues.apache.org/jira/browse/LOG4J2-1074?focusedCommentId=14614206&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14614206]
to only capture the extra info if any of the layouts in the configuration file
contains a NanoTimePatternConverter (the new format specifier for nano time) -
so we won't impact users who did not ask for this data.
> Add a logformat token for nanotime
> ----------------------------------
>
> Key: LOG4J2-1074
> URL: https://issues.apache.org/jira/browse/LOG4J2-1074
> Project: Log4j 2
> Issue Type: New Feature
> Reporter: Will Hains
>
> Add a token in the log format specifier to output the current value of
> {{System.nanotime()}}.
> We are currently adding the nanotime value to our log messages manually,
> which we find very useful for troubleshooting unexpected latency, and as a
> quick-and-dirty data source to feed into performance analysis tools.
> It would be very nice if Log4j could do this for us. It would also be nice to
> have this in the log format specified, so we can turn it on/off at runtime by
> editing the Log4j config file.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]