You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RollingFileAppender counts unrelated prefix siblings as size backups #338
A non-static size-only RollingFileAppender can treat unrelated filenames that merely share the base-file prefix as numbered backups when initializing its backup count.
Reproduction
With an empty temporary directory except for log.txt.unrelated.5, configure an appender for log.txt with RollingStyle = Size, StaticLogFileName = false, and unlimited backups. The startup scan accepts the sibling by prefix; backup-index parsing then treats its final .5 as an index. CurrentSizeRollBackups becomes 5 even though there are no backups of log.txt, which can make the next size-backup index begin at 6.
A synthetic NUnit regression test reproduced the baseline behavior: expected 0, observed 5. The proposed guard makes that test pass. Static-name and date-rolling paths are not implicated by this case.
Verification and disclosure
The focused regression test failed against the frozen baseline and passed with the proposed guard. The documented dotnet test src/log4net.sln run passed (log4net.Tests: 462 passed, 1 skipped; log4net.Ext.Mail.Tests: 52 passed). Restore emitted existing NU1902/NU1903 advisories for System.Security.Cryptography.Pkcs 10.0.0 in log4net.Ext.Mail.Tests.
The draft issue and proposed test/code were prepared with OpenAI Codex gpt-6-luna, operated by dajiaohuang. This disclosure does not claim independent human-authored verification.
Activity
count only the base name's backups without date rolling #338