Introduction
As part of Vault version 1.13.x, a new feature called operation log rotation was introduced which provides the maximum duration a log should be written to before it needs to be rotated. Must be a duration value such as 30s, and defaults to 24h.
Operation log rotation works for both active and standby nodes.
Scenario 1
Log rotation is set to 2 minutes and Logs are getting printed simultaneously then the log rotation will happen in every 2 minutes.
Scenario 2
Log rotation is set to 2 minutes and Logs are getting printed intermittently then the log rotation should be triggered post a new log line is printed.
eg
Users are having queries like "When the rotation duration is set to 5m then why do intermittently logs get rotated at random intervals like 7 minutes or 10 minutes?".
Behavior Explanation
Log files will only be rotated once a new log-line will stream in the new log rotation window.
For Example:- Suppose the time now is 01.00 PM and we have a log rotation at every 2 minutes. Ideally(if the logs are getting printed simultaneously), the next log file should get rotated at 01.02 PM, However, if no logs are printed in the file till 01.02 PM then the rotation will not happen and whenever a new log line is printed let's suppose at 01.05 PM then we will observe the rotation to trigger at 01.05 PM.
This similar behavior is applicable for both standby and active nodes.
Reference
https://developer.hashicorp.com/vault/docs/v1.13.x/commands/server#_log_rotate_duration