Skip to content

RollingFileAppender does not enumerate all existing rollback files and then overwrites logs during rollback creating gaps #236

@vladislav-dobzinski-etr

Description

I'm using log4net for .NET Framework version 2.0.8

RollingFileAppender is used with CountDirection=1

On startup log4net enumerates existing rollback files and sets curSizeRollBackups

Sometimes log4net does not discover ALL existing rollback files and then new rollback is created, deletes an existing file and creates new rollback. This behavior causes gaps in logs.

In attached log4net internal debug file there are issues with B7EBL.log.455, B7EBL.log.459, B7EBL.log.460 files
Files B7EBL.log.455 and B7EBL.log.459 were not discovered and curSizeRollBackups was not set correctly

log4net: File name [b7ebl.log.450] moves current count to [450]
log4net: curSizeRollBackups starts at [450]
...
log4net: Deleted file [E:\zurnalai\B7Logs\B7EBL.log.455]
log4net: Moving [E:\zurnalai\B7Logs\B7EBL.log] -> [E:\zurnalai\B7Logs\B7EBL.log.455]
...
log4net: File name [b7ebl.log.458] moves current count to [458]
log4net: curSizeRollBackups starts at [458]
...
log4net: Deleted file [E:\zurnalai\B7Logs\B7EBL.log.459]
log4net: Moving [E:\zurnalai\B7Logs\B7EBL.log] -> [E:\zurnalai\B7Logs\B7EBL.log.459]
...
log4net: Deleted file [E:\zurnalai\B7Logs\B7EBL.log.460]
log4net: Moving [E:\zurnalai\B7Logs\B7EBL.log] -> [E:\zurnalai\B7Logs\B7EBL.log.460]

log4net.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions