Note
For V1.4, this parameter is available starting with V1.4.
Description
max_syslog_file_count specifies the maximum number of log files that can be retained before they are recycled.
Note
Each log file can occupy up to 256 MB of disk space.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | INT |
| Default value | 0, which means that no log files are deleted. |
| Value range | [0, +∞) |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
The total number of all types of logs cannot exceed
max_syslog_file_count. The oldest log files are recycled based on the FIFO (First In, First Out) strategy. The FIFO strategy selects the time of the last modification of a log file as the time node for log file recycling. For example, the log filexxxxxxxx.log.20231123223441234is sorted based on the ending time to determine the order of recycling.The number of log files is limited by
max_syslog_file_count. The total number ofxxxxxx.log.xxxxxfiles after rotation cannot exceedmax_syslog_file_count, and the total number ofxxxxxx.log.wf.xxxxxfiles after rotation also cannot exceedmax_syslog_file_count. Note that the active log files (such as observer.log and rootservice.log) and their corresponding WF files are not counted in this limit.If the generation speed of trace logs is too fast and the number of trace logs is too large, the space occupied by trace logs may exceed the space occupied by OBServer log files. In this case, OBServer log files may be recycled earlier. To avoid this situation, we recommend that you adjust the trace log level to control the number of trace logs. For more information, see Trace log level.
The relationship between the
max_syslog_file_countparameter and the syslog_disk_size parameter is as follows:max_syslog_file_count=0andsyslog_disk_size=0: No log files are recycled until the disk is full.max_syslog_file_count=0andsyslog_disk_size>0: When the total size of all log files approachessyslog_disk_size, the oldest log files are recycled.max_syslog_file_count>0andsyslog_disk_size=0: When the number of log files of a certain type exceedsmax_syslog_file_count, the oldest log files are recycled.max_syslog_file_count>0andsyslog_disk_size>0: When the number of log files of a certain type exceedsmax_syslog_file_countor when the total size of all log files approachessyslog_disk_size, the oldest log files are recycled.
Examples
Set the maximum number of log files that can be retained before they are recycled to 20.
obclient> ALTER SYSTEM SET max_syslog_file_count=20;
