Repository navigation
use a dated file name when the date pattern names files like backups - #336
Conversation
…335 With StaticLogFileName, .dd names the file of the 10th like backup 10, and a roll overwrote one with the other. * warn at activation and set StaticLogFileName to false * no report for a count-down limit below the smallest dated name * existing static file and its backups left untouched * startup scan of a dated name requires a dot after the name (.d)
* AGENTS.md: rule and example * InitializeFromOneFile: IsLogFile, IsBaseFile, IsBackupOfDatedFile
gdziadkiewicz
left a comment
There was a problem hiding this comment.
LGTM, asking Copilot to also take a look
There was a problem hiding this comment.
🟡 Changes recommended
The single-date heuristic produces false positives and still misses longer numeric patterns that can collide with unbounded count-up backups.
3 open findings
What changed in this PR
Fixes short date patterns colliding with numbered rolling-file backups.
Changes:
- Detects collisions and switches to dated filenames.
- Tightens dated-backup scanning and adds regression tests.
- Updates documentation, changelog, and contributor guidance.
| File | Description |
|---|---|
AGENTS.md |
Documents conditional-logic style. |
RollingFileAppender.cs |
Adds collision handling and scan fixes. |
RollingFileAppenderShortDatePatternTest.cs |
Tests collision and startup behavior. |
rollingfileappender.adoc |
Documents short-pattern handling. |
335-short-date-pattern-collides-with-backup-names.xml |
Records the fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Count-up backup indices are unbounded, so a numeric .yyyyM meets backup 20261 one day. * warning, changelog and manual name the default .yyyy-MM-dd
|
Implementation plan for #335, kept here for the record. It covers the change, the tests, the PlanPlan for #335: short date pattern collides with size backup namesContextIssue #335 (split out of #334, reported by @Snotface): with Why files get destroyed (
Decision: report at activation and switch to a dated file name, that is set Not a collision, and must not be reported: the default count-down setup with a finite limit. With Known and accepted: the 1970 sample is the narrowest formatting of every numeric field except A second defect, pre-existing from #334, surfaces as soon as Steps0. Branch
1.
|


Fixes #335. With
StaticLogFileName, aDatePatternsuch as.ddnames the file of the 10thlog.txt.10, which is also backup 10, and a roll overwrote one with the other.StaticLogFileNameto false, so the live file is the dated one and its backups are numbered after the date.ddwith 5 backups).dthe files of the 11th no longer count as backups of the 1st