caddy
caddy copied to clipboard
Enhancement: zstd support for rotated logs
Until #5316 is solved, I'd like support for zstd compressed logfiles. Especially with --long
and -T
options, zstd is quite a lot more efficient than plain zlib/gzip.
Example using zstd --long -15
-rw------- 1 caddy caddy 100M Sep 20 20:31 wiki.tnonline.net_443-2023-09-20T18-31-05.411.log
-rw------- 1 caddy caddy 7,8M Sep 20 20:31 wiki.tnonline.net_443-2023-09-20T18-31-05.411.log.gz
-rw------- 1 caddy caddy 4,8M Sep 20 20:31 wiki.tnonline.net_443-2023-09-20T18-31-05.411.log.zst
Log rotation is handled by the library we use, lumberjack. That library has unfortunately fallen out of maintenance (see issues/discussion board on its repo for details). We don't really have time to fork and take on maintaining it on top of maintaining Caddy, so we need the community's help for fixes/features relevant to Caddy.
Oh I see. Then it is better to implement support for external log rotate tools as suggested in #5316 and avoid using lumberjack.
Edit: is it this lumberjack package? It seems to have at least some activity. There's also a PR for recreating log files that were removed by external tools. https://github.com/natefinch/lumberjack
Edit: is it this lumberjack package? It seems to have at least some activity. There's also a PR for recreating log files that were removed by external tools. https://github.com/natefinch/lumberjack
Lumberjack is still maintained from time-to-time, but it's mostly development of v2. Since it's a big change, we can't really switch to it for something like this easily until it's done/ready for use.