Previous Next JavaScript must be enabled to correctly display this content

## Log File Compression

You can compress the log files by setting the `serviceLogFileCompression` Storage Node parameter. This helps to store significantly more logging output in the same amount of disk space. As a result, the logs can be retained for a longer period, rendering their availability for debugging purposes. The log files are compressed with the standard `gzip` algorithm. By default, the compression of log files stores approximately five times more data as compared with uncompressed files.

When you enable the log file compression, restart the associated Storage Node Agent for the new setting to take effect on the new files and compress the existing files. The size of log files may temporarily exceed the defined limits in certain cases. The rotated copies of the store-combined debug logs, statistics files, and performance files are compressed. Additionally, the service debug log files across all Storage Nodes, Replication Nodes, Admins, and Arbiters are compressed.

The compressed rotated log files are renamed with a `.gz` suffix and the file name is modified to use the creation time instead of the standard log rotation number.

For example:

Precompressed log file | Post compressed log file
--- | ---
rg1-rn1_1.log | rg1-rn1_20220720-201902.log.gz

Here, the standard rotated log file `rg1-rn1_1.log` is renamed to `rg1-rn1_20220720-201902.log.gz` after compression. The date part of the log file implies that the file was created on `2022-07-20 20:19:02 UTC`.

If multiple rotated log files are created in the same second, a unique suffix is added to the date portion of the file name.

For example: `rg1-rn1_20220720-201902-1.log.gz`.

Note:

- To avoid the usage of extra disk space in the standard log directory, you can use the `gzcat` command to view the contents without uncompressing the zipped files. Use the `zgrep` command to search the compressed log files. You can also uncompress the files into another directory. Manually uncompressed files are not deleted automatically.
- The Bootstrap debug log files, GC log files, JE debug log files, and JE statistics files are not compressed.