Browse Source

logging: Fix off-by-one for roll size MB from Caddyfile

"10mb" now results in 10, rather than 9.
master
Matthew Holt 5 years ago
parent
commit
9af05719bc
  1. 2
      modules/logging/filewriter.go

2
modules/logging/filewriter.go

@ -168,7 +168,7 @@ func (fw *FileWriter) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if err != nil {
return d.Errf("parsing size: %v", err)
}
fw.RollSizeMB = int(size) / 1024 / 1024
fw.RollSizeMB = int(size)/1024/1024 + 1
case "roll_keep":
var keepStr string

Loading…
Cancel
Save