Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
1.3.1
-
None
Description
logback creates the timestamp of a LoggingEvent using:
Instant instant = Clock.systemUTC().instant(); initTmestampFields(instant);
Thus the time of the server is used to generate the timestamp of an entry. In scenarios where this time is not correct, the application can not influence the timestamps.
Log4j has a clock interface (org.apache.logging.log4j.core.util.Clock) that can be implemented to achieve this task. The clock implementation can apply offsets to the system time.
Would it be possibe to use a configurable clock instead of Clock.systemUTC() in logback?