Skip to content

roll_interval does not support "d" (day) duration #7864

Description

@StroppaFR

Issue Details

Documentation about the roll_interval log rotation option at https://caddyserver.com/docs/caddyfile/directives/log#roll_interval states that it supports duration strings (https://caddyserver.com/docs/conventions#durations), including d for day.

But trying to set roll_interval 1d in a Caddyfile fails with an error when starting Caddy.

mywebsite:80 {
    log {
        output file /var/log/caddy/mywebsite.log {
            roll_interval 1d
        }
        format json
    }
    respond "OK"
}
# caddy --version
v2.11.4 h1:XKxkMTgNSizEvKG6QHue6cAsFOteU2qA61w2tKkCWi0=
# caddy run --environ --config /etc/caddy/Caddyfile
[...]
Error: adapting config using caddyfile: parsing caddyfile tokens for 'log': parsing roll_interval duration: time: unknown unit "d" in duration "1d", at /etc/caddy/Caddyfile:4

Assistance Disclosure

AI not used

If AI was used, describe the extent to which it was used.

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions