-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Hi Team,
We are using Logback with a TimeBasedRollingPolicy
configured to roll logs on a monthly basis. We've noticed that the rollover to a new log file does not occur automatically when the new month starts -- it only happens after a new log entry is written. This behavior appears consistent even if the configured rollover time (e.g., the 1st of the month) has already passed.
We would like to confirm:
-
Is it expected behavior that Logback only performs time-based rollover when a log event is triggered?
-
If so, is there a recommended way to proactively trigger or force a rollover at the time boundary?
-
Are there any APIs or hooks we can use to check the rollover condition and initiate it manually without writing a log event?
Any guidance or best practices on how to handle this scenario would be greatly appreciated, especially in systems where logging may be quiet for long periods but we still want timely log archival.