tryCatchLog icon indicating copy to clipboard operation
tryCatchLog copied to clipboard

Support UTC time stamps in logs

Open aryoda opened this issue 5 years ago • 1 comments

The current implementation seems to log local times, not UTC.

This makes it difficult to correlate log entries of different services on the same and other computers to get a holistic picture of log events.

The internal implementations uses

https://github.com/aryoda/tryCatchLog/blob/f3fdebd8bc6cd3a867fa2283fbb5f00df0c34b08/R/tryCatchLog.R#L239

which returns an absolute date-time value of class POSIXct but when a log entry is created the local time zone may be applied...

aryoda avatar Apr 19 '20 14:04 aryoda

On the other hand using only UTC drives me crazy when I try to understand logs and my timezone is different (eg. searching and filtering requires time zone calculations).

I suggest to add another column named "timezone.UTC" to build.log.entry() to let the user see both time zones (local + UTC).

And the time zone of the logging framework output should be left untouched in tryCatchLog since it is a configuration (or default setting) of the logging framework.

aryoda avatar Jul 31 '22 16:07 aryoda