Monitoring Log
Overview
When the size of sysmonitor.log (monitoring log) reaches a preset value, this log will be truncated. By default, the cron service calls the logrotate mechanism every hour to read the configurations from /usr/libexec/sysmonitor/log_dump.conf. When the size of /var/log/sysmonitor.log exceeds a preset value, the log is truncated. The truncated log is stored as a .zip file.
Configuration Description
/usr/libexec/sysmonitor/log_dump.conf is configuration file of the monitoring log.
/var/log/sysmonitor.log { create compress rotate 20 maxage 30 missingok notifempty size +8192k sharedscripts }
Parameter description:
- create: create a new log file.
- compress: compress the backup log file.
- rotate20: retain 20 truncated log files.
- maxage 30: retain logs that are generated in the last 30 days.
- missingok: skip the log file if the log file does not exist.
- notifempty: do not truncate the log file if the log file is empty.
- size +8192k: truncate the log when the log size reaches 8192 KB.
- sharedscripts: run the specified script when truncating log files.
Limitation on Log Truncation
If you set rotate to 5 in the configuration file, and then modify rotate to 3 after five truncated log files are generated, no more log files will be truncated in this case.