[
https://issues.apache.org/jira/browse/LOG4J2-982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mikhail Mazurskiy updated LOG4J2-982:
-------------------------------------
Attachment: LOG4J2-982.patch
Attaching proposed patch.
p.s. Also there is a bug in the
{{org.apache.logging.log4j.core.config.FileConfigurationMonitor}} constructor -
it uses {{interval}} argument (which is in seconds) instead of {{interval}}
field (which is in milliseconds).
p.p.s. Is there a reason for
{{org.apache.logging.log4j.core.util.Constants#MILLIS_IN_SECONDS}}? Why not
just use {{TimeUnit}} conversion methods?
> Use System.nanoTime() to measure time intervals
> -----------------------------------------------
>
> Key: LOG4J2-982
> URL: https://issues.apache.org/jira/browse/LOG4J2-982
> Project: Log4j 2
> Issue Type: Improvement
> Components: Core, Flume Appender
> Reporter: Mikhail Mazurskiy
> Priority: Minor
> Attachments: LOG4J2-982.patch
>
>
> Unlike {{System.currentTimeMillis()}}, which can jump/slew forward and
> backwards, {{System.nanoTime()}} is a monotonic clock (at least it should be)
> and hence it should be used to measure time intervals (timeouts/delays/etc).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]