(U) Rotate syslog-ng log files
CLASSIFICATION: UNCLASSIFIED Hello, Currently we have syslog writing a single file (syslog.log) that just grows exponentially? What we are trying to do is rotate the syslog.log file once it reaches 500 MB (as well as looking into rotating file every 24 hours)? Once the log file rotates, it creates a new file named syslog.log.0 and so on.. Can someone please tell me how do I go about doing so and what specific configuration I need to have it in place in syslog-ng.conf file to achieve this? Thanks Jitesh Amin CLASSIFICATION: UNCLASSIFIED
Hi!
"Amin" == Amin, Jitesh CTR DISA JSP (US) <jitesh.amin.ctr@mail.mil> writes:
Amin> What we are trying to do is rotate the syslog.log file once it Amin> reaches 500 MB (as well as looking into rotating file every 24 Amin> hours)? Once the log file rotates, it creates a new file named Amin> syslog.log.0 and so on.. syslog-ng does not support size-based rotation, you'll have to configure logrotate for that. See the packaging/debian/syslog-ng-core.syslog-ng.logrotate[1] file for an example. [1]: https://github.com/balabit/syslog-ng/blob/master/packaging/debian/syslog-ng-... With logrotate, the most recent logfile syslog-ng writes to will always be syslog.log, and the rotated files will have different names - depending on the logrotate configuration you use. For time-based, daily rotation, you can use templates in the destination filename, such as: destination d_syslog { file("/var/log/syslog-${YEAR}-${MONTH}-${DAY}.log"); }; Hope this helps! -- |8]
participants (2)
-
Amin, Jitesh CTR DISA JSP (US)
-
Gergely Nagy