Note
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.
Privilege requirements
Query the parameter
The
systenant and all user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
Only the
systenant can modify this parameter. User tenants cannot modify this parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | INT |
| Default value | 0, which indicates 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. |
Usage instructions
The total number of all types of log files is limited by
max_syslog_file_count, and the FIFO (First-In, First-Out) strategy is used for log file eviction. The FIFO strategy determines the eviction order based on the last modification time of the log files. For example, files likexxxxxxxx.log.20231123223441234are sorted by their ending timestamp to decide which files are deleted first.The file retention rule is as follows: The total number of all rotated
xxxxxx.log.xxxxxfiles is limited by the value ofmax_syslog_file_count, and the same limit applies to all rotatedxxxxxx.log.wf.xxxxxfiles. Note that currently active log files being written (such as observer.log, rootservice.log) and their corresponding WF files are not included in this count.If Trace logs are generated too quickly and in large quantities, they may occupy space intended for OBServer log files, causing OBServer logs to be evicted earlier than expected. In such cases, it is recommended to adjust the full-link tracing level to control the amount of logs generated. For details about Trace log levels, see End-to-end tracing methods.
The relationship between the parameters
max_syslog_file_countand syslog_disk_size is as follows:max_syslog_file_count=0,syslog_disk_size=0: No log recycling occurs until the disk is full.max_syslog_file_count=0,syslog_disk_size>0: When the total log size approachessyslog_disk_size, the oldest log files are deleted to free up 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 free up 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.
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;