Skip to content

Document -1 as the value that disables roll_keep#556

Open
Socialpranker wants to merge 1 commit into
caddyserver:masterfrom
Socialpranker:fix-roll-keep-docs
Open

Document -1 as the value that disables roll_keep#556
Socialpranker wants to merge 1 commit into
caddyserver:masterfrom
Socialpranker:fix-roll-keep-docs

Conversation

@Socialpranker

Copy link
Copy Markdown

Fixes caddyserver/caddy#7863

Summary

The roll_keep docs say to set the value to 0 to disable the retention limit, but that's not what the code does: modules/logging/filewriter.go treats a RollKeep of 0 as "not set" and falls back to the default of 10 (filewriter.go#L258-L260). The value that actually removes the limit is -1, which the underlying rotator (lumberjack) treats as "no limit" for any MaxBackups <= 0.

A maintainer confirmed this in the issue thread and noted the fix belongs here (in the docs), not in a behavior change to caddy itself.

Change

One-line correction to the roll_keep description: documents -1 as the disabling value and explains that 0 falls back to the default of 10 instead of disabling anything.

Test plan

  • Read the corrected sentence against filewriter.go's actual RollKeep/MaxBackups handling to confirm the new wording matches behavior.
  • This is a documentation-only change with no code or build output to run.

The roll_keep docs said to set the value to 0 to disable log rotation
retention limits, but modules/logging/filewriter.go treats a RollKeep
of 0 as "not set" and falls back to the default of 10
(https://github.com/caddyserver/caddy/blob/master/modules/logging/filewriter.go#L258-L260).
The value that actually disables the limit is -1, which lumberjack (the
underlying rotator) treats as MaxBackups <= 0, meaning no limit.

Reported in caddyserver/caddy#7863, where a maintainer confirmed this is
a documentation bug and that the smallest compatible fix is documenting
-1 as the disabling value, rather than changing filewriter.go's
behavior.

Fixes caddyserver/caddy#7863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting roll_keep to 0 does not disable it

1 participant