You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to make the NATS server producing a log file and, optionally, it's possible to enable maximum file size.
When the log file reaches the maximum size, the file is rotated.
Everything works but would be nice if we could set the maximum number of "old" log file to keep. In this way we can limit the maximum disk size occupied by log files. (MAX_SIZE * MAX_NUMBER_OF_FILE)
Use Case:
The use case is nats-server running on a machine and we want to avoid that the total log files use too much disk space
Proposed Change:
Introduce a configuration setting (for instance logfile_max_count: int) that allows to set the maximum number of log files.
Each time the server rotate the log file, it can check if there're already enough "old" files and deletes the oldest one before to create a new one.
Who Benefits From The Change(s)?
Whoever cannot use logrotate
Alternative Approaches
Redirect the stderr to a file and use logrotate.
The text was updated successfully, but these errors were encountered:
I also tried to configure to archive or remove old logs using logrotate based on file extension, since the rotated file logs contain an extension of suffix: .yyyy.mm.dd.hh.mm.ss.micros which is making it difficult to select using logrotate.
I have proposed a PR #5815 which rotates logs with .log file extension like: nats-server.2024.08.25.14.37.57.558600300.log
Feature Request
It's possible to make the NATS server producing a log file and, optionally, it's possible to enable maximum file size.
When the log file reaches the maximum size, the file is rotated.
Everything works but would be nice if we could set the maximum number of "old" log file to keep. In this way we can limit the maximum disk size occupied by log files. (MAX_SIZE * MAX_NUMBER_OF_FILE)
Use Case:
The use case is
nats-server
running on a machine and we want to avoid that the total log files use too much disk spaceProposed Change:
Introduce a configuration setting (for instance
logfile_max_count
: int) that allows to set the maximum number of log files.Each time the server rotate the log file, it can check if there're already enough "old" files and deletes the oldest one before to create a new one.
Who Benefits From The Change(s)?
Whoever cannot use logrotate
Alternative Approaches
Redirect the stderr to a file and use logrotate.
The text was updated successfully, but these errors were encountered: