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
- This parameter only controls the number of uncompressed log files.
- Each log file can occupy up to 256 MB of disk space.
Privilege requirements
Query the parameter
The
systenant and all user tenants can use theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query this parameter.Modify the parameter
Only the
systenant can modify this parameter. User tenants cannot modify this parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | INT |
| Default value | 0, indicating that no log files are deleted. |
| 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 log files of all types cannot exceed
max_syslog_file_count. Log files are recycled based on the FIFO (First In, First Out) strategy. The FIFO strategy selects the log file based on the last modification time of the log file. For example, the log filesxxxxxxxx.log.20231123223441234are sorted based on their end time to determine the order of recycling.The file retention rule is as follows: the total number of rotated
xxxxxx.log.xxxxxfiles cannot exceedmax_syslog_file_count, and the total number of rotatedxxxxxx.log.wf.xxxxxfiles cannot exceedmax_syslog_file_count. Note that the active log files (such as observer.log and rootservice.log) being written to and their corresponding WF files are not counted in this limit.If trace logs are generated too quickly and in large quantities, they may occupy the disk space of OBServer log files, leading to the early recycling of OBServer logs. In this case, we recommend that you adjust the trace log level to determine the appropriate log volume. For more information about trace log levels, see Trace log levels.
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: indicates that logs are not recycled until the disk is full.max_syslog_file_count=0andsyslog_disk_size>0: when the total size of logs approachessyslog_disk_size, the oldest log files are deleted to recycle space.max_syslog_file_count>0andsyslog_disk_size=0: when the number of a type of log file exceedsmax_syslog_file_count, the oldest log files are deleted to recycle space.max_syslog_file_count>0andsyslog_disk_size>0: when the number of a type of log file exceedsmax_syslog_file_countor when the total size of logs approachessyslog_disk_size, the oldest compressed files are deleted to recycle space.
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;