Historically, newsyslog compressed rotated log files to save disk space. This was
useful in the early days. However, but with the advent ofwith modern file systems like ZFS,ZFS offering native
which offer native compression, and with the availability of larger hard drives, the benefits of
benefits of additional compression arhave become less compelling.significant. This is especialparticularly true
considering the inconvenience of having to decompressing log files when searching for
for specific patterns.
Additionally, the historicaloriginal implementation of compression methods lackswas not future-proof.
future-proofing. ThereforeAs a result, we have redefined the J, X, Y, Z flags to meansignify "treat the file as
"treat the file as compressible" instead ofrather than "compress the file with that particularspecific method."
method".
A new command -line option, -c, has been introduced to allow override theseing these settings
settings in ain a more future-proof mannerway. The followingavailable choices are now available:e:
none - default: do not compress, regardless of flag.
legacy - historical behavior: J=bzip2, X=xz, Y=zstd, Z=gzip.
bzip2, xz, zstd, gzip - use the specified compression methodapply the specified compression method.
Currently, the default is set to 'legacy' to preserve historical behavior. However,
our intention is to change this default to 'none' in FreeBSD 15.0.
Additionally, this update changes the default settings for zstd to use multithreading
and long-range options, better aligning with its intended use.
Inspired by D42961