dajiaohuang opened a new issue, #338: URL: https://github.com/apache/logging-log4net/issues/338
## Summary 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
