Overview
max_syslog_file_count specifies the maximum number of log files that can be retained before log files are recycled.
Note
Each log file can occupy up to 256 MB of disk space.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | INT |
| Default Value | 0: No log files will be deleted. |
| Value range | 0, +∞) |
| Modifiable | Yes, you can use the following methods:ALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | No, the setting takes effect immediately. |
Usage instructions
The total number of logs of all types must not exceed
max_syslog_file_count. Log files are evicted using a First In, First Out (FIFO) strategy. The time point used for the FIFO selection is the last modification time of the log. For example, log files are sorted by their last modification time to determine the order in which they are evicted.The file count retention rule specifies that the total number of rotated
xxxxxx.log.xxxxxfiles shall not exceedmax_syslog_file_count, and the total number of rotatedxxxxxx.log.wf.xxxxxfiles shall also not exceedmax_syslog_file_count. Note that active log files currently being written to, such as observer.log and rootservice.log, and their corresponding WF files are excluded from this quantity limit.If trace logs are generated too quickly and in large quantities, they may consume the log file space of the OBServer node, causing the OBServer logs to be evicted prematurely. In this case, we recommend that you adjust the end-to-end tracing level to determine an appropriate log volume. For details about trace log levels, see [End-to-end tracing method].
The relationship between the
max_syslog_file_countparameter and the syslog_disk_size parameter:max_syslog_file_count=0,syslog_disk_size=0: No logs are recycled until the disk is full.max_syslog_file_count=0,syslog_disk_size>0: When the total log size approachessyslog_disk_size, start deleting the oldest log files to reclaim space;max_syslog_file_count>0,syslog_disk_size=0: When the number of a certain type of log file exceedsmax_syslog_file_count, the oldest log files are deleted to reclaim space;max_syslog_file_count>0,syslog_disk_size>0: When the number of a certain type of log file exceedsmax_syslog_file_count, or when the total log size approachessyslog_disk_size, the oldest compressed files are deleted.
Configuration example
The number of log files that can be retained before recycling is set to 20.
obclient> ALTER SYSTEM SET max_syslog_file_count=20;