Reference: log rotation
This article explains advanced configuration of installer to control log rotation and retention.
Logs rotation policies
The following policies control the rotation and expiration of logs on the PM server in INSTALL_DIR/logs directory:
Size-based log rotation for current date.
When an original log file reaches its maximum, it is rotated and the suffix is added.
Number of rotated files: 7. Parameter logs_rotate_count in PACKAGE_DIR/group_vars/all/vars.yml).
Maximum size of a file: 200MB. Parameters logs_rotate_maxsize and logs_rotate_size in PACKAGE_DIR/group_vars/all/vars.yml).
If the log file size exceeds the Maximum size * Number of rotated files (by default 1.4GB), log data is removed from the central server, but remains on the source server.
Log compression.
All files older than today will be automatically compressed with gunzip.
Log cleanup.
All files older than 14 days will be automatically removed from the aggregation server.
This behaviour is configured in installer's PACKAGE_DIR/group_vars/all/vars.yml file, in parameter logs_retention, before installation of the INT server. If not specified, the default value is 13, which means that files older than 14 days are removed.
Log rotation configuration
These parameters are optional during the configuration process, but they may be used to control log retention in case of specific data storage policies.
| Configuration | Default | Description | Manual reconfiguration |
|---|---|---|---|
| logs_retention | 13 | The number of days to keep old logs (files older than 14 days will be deleted | |
| logs_rotate_count | 7 | The number of rotated files of the same log file during same date. The parameter is used to control piece size of logs | Edit <install-dir>/logrotate/logrotate.d/wf_aggregated_logs.conf |
logs_rotate_maxsize logs_rotate_size |
200M | Should be same for both options. Size of each rotated file | Edit <install-dir>/logrotate/logrotate.d/wf_aggregated_logs.conf |