22title : Configuring log rotation
33id : adm-pract-rotate
44description : >-
5- The {{ site.product.short_name }} application does not rotate logs by itself. This chapter
6- describes how to use {{ site.product.short_name }} for log rotation .
5+ This chapter describes how to use {{ site.product.short_name }} for log rotation, making use of builtin options
6+ and external tools .
77---
88
9- Consider the following approaches:
9+ Log rotation is traditionally only applicable to files and, consequently,
10+ to file destination drivers in {{ site.product.short_name }}. Consider the following approaches:
11+
12+ ## Use builtin logrotate() option of file destination driver
13+
14+ - It is available starting with {{ site.product.short_name }} version 4.10 or later.
15+
16+ - It is performed based on file sizes.
17+
18+ - No additional configuration files are required - log rotation is configured
19+ with the rest of {{ site.product.short_name }}. For details, see [[ file() destination options]] .
20+
21+ ## Separate incoming logs based on time, host or other information
22+
23+ - It is ideal for central log servers, where regular restart of
24+ {{ site.product.short_name }} is unfavorable.
25+
26+ - Requires shell scripts or cron jobs to remove old logs.
27+
28+ - It can be done by using macros in the destination name (in the
29+ filename, directory name, or the database table name). (For details
30+ on using macros, see Templates and macros)
1031
1132## Use logrotate together with {{ site.product.short_name }}
1233
@@ -20,23 +41,15 @@ Consider the following approaches:
2041- Requires frequent restart ({{ site.product.short_name }} must be reloaded/restarted
2142 when the files are rotated). After rotating the log files, reload
2243 {{ site.product.short_name }} using the ** syslog-ng-ctl reload** command, or use
23- another method to send a SIGHUP to {{ site.product.short_name }}.
44+ another method to send a SIGHUP to {{ site.product.short_name }}. Alternatively,
45+ starting from {{ site.product.short_name }} version 3.13 or later ** syslog-ng-ctl reopen**
46+ may be used to signal file destination drivers to open log files again without stopping
47+ or interrupting the rest of configured log pipes.
2448
2549- The statistics collected by {{ site.product.short_name }}, and the correlation
2650 information gathered with Pattern Database, are lost with each
2751 restart.
2852
29- ## Separate incoming logs based on time, host or other information
30-
31- - It is ideal for central log servers, where regular restart of
32- {{ site.product.short_name }} is unfavorable.
33-
34- - Requires shell scripts or cron jobs to remove old logs.
35-
36- - It can be done by using macros in the destination name (in the
37- filename, directory name, or the database table name). (For details
38- on using macros, see Templates and macros
39-
4053### Example: File destination for log rotation
4154
4255This sample file destination configuration stores incoming logs in files
0 commit comments