From e602d39fd75c96299e55d8f8d543dd0ed830203a Mon Sep 17 00:00:00 2001 From: ainsley Date: Mon, 3 Feb 2020 16:15:37 -0600 Subject: [PATCH] updating logging to include log_size_limit --- nats-server/configuration/logging.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nats-server/configuration/logging.md b/nats-server/configuration/logging.md index 71de673..9276375 100644 --- a/nats-server/configuration/logging.md +++ b/nats-server/configuration/logging.md @@ -64,12 +64,15 @@ All of these settings are available in the configuration file as well. debug: false trace: true logtime: false +log_size_limit: 1GB log_file: "/tmp/nats-server.log" ``` -### Log Rotation with logrotate +### Log Rotation -NATS server does not provide tools to manage log files, but it does include mechanisms that make log rotation simple. We can use this mechanism with [logrotate](https://github.com/logrotate/logrotate); a simple standard Linux utility to rotate logs available on most distributions like Debian, Ubuntu, RedHat \(CentOS\), etc. +Introduced in NATS Server v2.1.4, NATS allows for auto-rotation of log files when the size is greater than the configured limit. The backup files will have the same name as the original log file with the suffix .yyyy.mm.dd.hh.mm.ss.micros. + +You can also use NATS-included mechanisms with [logrotate](https://github.com/logrotate/logrotate), a simple standard Linux utility to rotate logs available on most distributions like Debian, Ubuntu, RedHat \(CentOS\), etc., to make log rotation simple. For example, you could configure `logrotate` with: