diff options
author | Francis Lavoie <[email protected]> | 2022-01-04 14:11:27 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2022-01-04 12:11:27 -0700 |
commit | 249adc1c872ae46e640cfb7c330e332229d8d32a (patch) | |
tree | d9102381e448710a3530596f73afbf93036ff4d7 /modules/logging | |
parent | e9dde230247ec5525d4c3803ff99c97e0dc8e348 (diff) | |
download | caddy-249adc1c872ae46e640cfb7c330e332229d8d32a.tar.gz caddy-249adc1c872ae46e640cfb7c330e332229d8d32a.zip |
logging: Support turning off roll compression via Caddyfile (#4505)
Diffstat (limited to 'modules/logging')
-rw-r--r-- | modules/logging/filewriter.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/logging/filewriter.go b/modules/logging/filewriter.go index 376deeb2e..7333fb20e 100644 --- a/modules/logging/filewriter.go +++ b/modules/logging/filewriter.go @@ -134,6 +134,7 @@ func (fw FileWriter) OpenWriter() (io.WriteCloser, error) { // file <filename> { // roll_disabled // roll_size <size> +// roll_uncompressed // roll_keep <num> // roll_keep_for <days> // } @@ -141,6 +142,9 @@ func (fw FileWriter) OpenWriter() (io.WriteCloser, error) { // The roll_size value has megabyte resolution. // Fractional values are rounded up to the next whole megabyte (MiB). // +// By default, compression is enabled, but can be turned off by setting +// the roll_uncompressed option. +// // The roll_keep_for duration has day resolution. // Fractional values are rounded up to the next whole number of days. // @@ -177,6 +181,13 @@ func (fw *FileWriter) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { } fw.RollSizeMB = int(math.Ceil(float64(size) / humanize.MiByte)) + case "roll_uncompressed": + var f bool + fw.RollCompress = &f + if d.NextArg() { + return d.ArgErr() + } + case "roll_keep": var keepStr string if !d.AllArgs(&keepStr) { |