caddy icon indicating copy to clipboard operation
caddy copied to clipboard

Enhancement: zstd support for rotated logs

Open Forza-tng opened this issue 1 year ago • 3 comments

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

Forza-tng avatar Sep 30 '23 07:09 Forza-tng

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.

francislavoie avatar Sep 30 '23 12:09 francislavoie

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

Forza-tng avatar Sep 30 '23 12:09 Forza-tng

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.

mholt avatar Sep 30 '23 21:09 mholt