I have this in my Caddyfile for logging requests. In this setup, old log files are renamed and compressed to have a .gz
extension automatically.
log {
output file /var/log/caddy/access.log {
roll_size 3MiB
roll_keep 5
roll_keep_for 5d
}
format filter {
wrap json
fields {
common_log delete
}
}
}
Is there a way I can skip compression (but still have the log files rotated)? This would allow me to simplify certain automated tasks that I run on these log files.
Mohammed90
(Mohammed Al Sahaf)
January 29, 2022, 7:03pm
2
Yep, there’s the roll_gzip
config knob for that.
1 Like
matt
(Matt Holt)
January 29, 2022, 7:57pm
3
Hmm, looks like we haven’t exposed this in the Caddyfile yet. Probably the first request I’ve seen for it!
Actually, it’s been added in the master
branch as the roll_uncompressed
option. It’ll be in the next release!
caddyserver:master
← caddyserver:log-compression-caddyfile
opened 10:19AM - 04 Jan 22 UTC
As requested in https://caddy.community/t/caddyfile-vs-json-config-roll-gzip/145… 64
3 Likes
system
(system)
Closed
February 28, 2022, 6:23pm
5
This topic was automatically closed after 30 days. New replies are no longer allowed.