Overview
syslog_compress_func is used to set the compression algorithm for system logs.
When the compression feature is enabled, four timestamped log files—observer.log, rootservice.log, election.log, and trace.log—will be compressed. The corresponding files with the .wf suffix will not be compressed.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Only the
systenant can modify this parameter. User tenants cannot modify it.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | String |
| Default Value | none: Do not compress system log files. |
| Value range | none, zstd_1.0, zstd_1.3.8 |
| 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
After the log compression algorithm is configured, log compression does not start immediately. Instead, it waits until the number of logs or disk usage reaches the specified limit, then compresses from the oldest log file. This retains more uncompressed logs, facilitating log analysis and troubleshooting.
After the value of
syslog_compress_funcis modified, subsequent logs will be compressed using the new algorithm. Existing compressed log files do not need to be changed. When deleting log files, only timestamps are compared; file extensions are not distinguished.Relationship between the
syslog_compress_funcparameter and the syslog_file_uncompressed_count, syslog_disk_size, and max_syslog_file_count parameters:syslog_compress_func =none:- The value of
syslog_file_uncompressed_countis invalid; syslog_disk_sizeandmax_syslog_file_countjointly control the upper limit on log files, enforcing both quantity and size constraints.
- The value of
syslog_compress_func !=none:- The value of
max_syslog_file_countis invalid; - Compress the logs that exceed the value of
syslog_file_uncompressed_count. Start deleting the oldest logs when the total size approaches the value ofsyslog_disk_size.
- The value of
Configuration example
Set the system log compression algorithm to zstd_1.3.8.
obclient> ALTER SYSTEM SET syslog_compress_func = 'zstd_1.3.8';
References
- Logs
- Log control methods