mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 13:43:47 +03:00
logging: Add roll_local_time
Caddyfile option (#4583)
This commit is contained in:
parent
ddbb234d91
commit
c921e08296
2 changed files with 9 additions and 0 deletions
|
@ -4,6 +4,7 @@ log {
|
|||
output file /var/log/access.log {
|
||||
roll_size 1gb
|
||||
roll_uncompressed
|
||||
roll_local_time
|
||||
roll_keep 5
|
||||
roll_keep_for 90d
|
||||
}
|
||||
|
@ -24,6 +25,7 @@ log {
|
|||
"roll_gzip": false,
|
||||
"roll_keep": 5,
|
||||
"roll_keep_days": 90,
|
||||
"roll_local_time": true,
|
||||
"roll_size_mb": 954
|
||||
},
|
||||
"include": [
|
||||
|
|
|
@ -135,6 +135,7 @@ func (fw FileWriter) OpenWriter() (io.WriteCloser, error) {
|
|||
// roll_disabled
|
||||
// roll_size <size>
|
||||
// roll_uncompressed
|
||||
// roll_local_time
|
||||
// roll_keep <num>
|
||||
// roll_keep_for <days>
|
||||
// }
|
||||
|
@ -188,6 +189,12 @@ func (fw *FileWriter) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
|||
return d.ArgErr()
|
||||
}
|
||||
|
||||
case "roll_local_time":
|
||||
fw.RollLocalTime = true
|
||||
if d.NextArg() {
|
||||
return d.ArgErr()
|
||||
}
|
||||
|
||||
case "roll_keep":
|
||||
var keepStr string
|
||||
if !d.AllArgs(&keepStr) {
|
||||
|
|
Loading…
Reference in a new issue