jvz commented on issue #2167: URL: https://github.com/apache/logging-log4j2/issues/2167#issuecomment-1879182380
Looking at your log file, I see that some debug logs do indeed have the unix milliseconds timestamp, but others don't, and that seems odd. The use of `%F` is also a little concerning; I'd typically use `%c`/`%logger` instead since that doesn't involve any stack walking to find the location info about the calling code. One thing that may be an issue here is that you're using `CachedClock` instead of the default `SystemClock`. The cached clock uses a background thread to update the time once every millisecond (which sort of relies on the underlying OS scheduler to support timers with a granularity that small; some OSes will only go as low as 10 ms or 16ms or somewhere around there) while the system clock just invokes `System::currentTimeMillis` every time. Since this log file is for debug logs, it might be that the log messages are being logged faster than the cached clock is updating itself, but then I'd expect the results to be the same timestamp being used (and not 0). Another thing is that you're using a custom `LoggerContext`, though I'm not sure if that's causing any problems. Do you still have this same problem with version 2.22.1? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
