Interval Rotation Persistence Across Instances #81
-
|
Hi, Quick question: Does interval rotation persist across instances? For example, if I spin up my service, configure timberjack to rotate every 7 days, then 2 days later I restart the server, will timberjack rotate the log 5 days from the restart or will the timer reset? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi, No, interval rotation does not persist across restarts.
In your example:
Timberjack will rotate 7 days from the restart (or first write after restart) — not 5 days later. If you need rotation aligned to real clock time (for example, rotate every day at midnight or at specific times regardless of restarts), use:
Those are clock-based and do not depend on an in-memory elapsed duration. Hope that helps! |
Beta Was this translation helpful? Give feedback.
@phreakazoid21
Hi,
No, interval rotation does not persist across restarts.
RotationIntervalis evaluated in memory againstlastRotationTime, which is initialized when theLoggerinstance starts and performs its first write. That value is not persisted to disk, so restarting your service effectively resets the interval timer.In your example:
RotationInterval = 7 daysTimberjack will rotate 7 days from the restart (or first write after restart) — not 5 days later.
If you need rotation aligned to real clock time (for example, rotate every day at midnight or at specific times regardless of restarts), use:
RotateAtMinutesRotateAt(e.g."…