### Changes proposed in this pull request: NATS Server 2.9 has `logfile_size_limit` option which allows the operator to set an optional byte limit on the NATS Server log file which when met causes a "rotation" such that the current log file is renamed (original file name appended with a time stamp to nanosecond accuracy) and a new log file is instantiated. This PR is a new `logfile_max_num` companion option (alias `log_max_num`) which allows the operator to designate that the server should prune the **total number of log files** -- the currently active log file plus backups -- to the maximum setting. A max value of `0` (the implicit default) or a negative number has meaning of unlimited log files (no maximum) as this is an opt-in feature. A max value of `1` is effectively a truncate-only logging pattern as any backup made at rotation will subsequently be purged. A max value of `2` will maintain the active log file plus the latest backup. And so on... > The currently active log file is never purged. Only backups are purged. When enabled, backup log deletion is evaluated inline after each successful rotation event. To be considered for log deletion, backup log files MUST adhere to the file naming format used in log rotation as well as agree with the current `logfile` name and location. Any other files or sub-directories in the log directory will be ignored. E.g. if an operator makes a manual copy of the log file to `logfile.bak` that file will not be evaluated as a backup. ### Typical use case: This feature is useful in a constrained hosting environment for NATS Server, for example an embedded, edge-compute, or IoT device scenario, in which _more featureful_ platform or operating system log management features do not exist or the complexity is not required.
NATS is a simple, secure and performant communications system for digital systems, services and devices. NATS is part of the Cloud Native Computing Foundation (CNCF). NATS has over 40 client language implementations, and its server can run on-premise, in the cloud, at the edge, and even on a Raspberry Pi. NATS can secure and simplify design and operation of modern distributed systems.
Documentation
- Official Website
- Official Documentation
- FAQ
- Watch a video overview of NATS.
- Watch this video from SCALE 13x to learn more about its origin story and design philosophy.
Contact
- Twitter: Follow us on Twitter!
- Google Groups: Where you can ask questions
- Slack: Click here to join. You can ask question to our maintainers and to the rich and active community.
Contributing
If you are interested in contributing to NATS, read about our...
Roadmap
The NATS product roadmap can be found here.
Security
Security Audit
A third party security audit was performed by Cure53, you can see the full report here.
Reporting Security Vulnerabilities
If you've found a vulnerability or a potential vulnerability in the NATS server, please let us know at nats-security.
License
Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.
