Skip to content

Max backup files not respected after application restart #888

@RazielXYZ

Description

@RazielXYZ

Describe the bug
The max backup files setting does not seem to be respected after restarting the program. Old log files are not touched and Quill creates the set amount of files again, after which it starts to overwrite only the newly created ones.
I'm not sure if this is a bug or intended, but it is not expected, at least for me.

To Reproduce

cfg.set_open_mode('w'); // (over)write
cfg.set_filename_append_option(quill::FilenameAppendOption::None);
cfg.set_rotation_max_file_size(1024 * 10); // 10 kB or some small value
cfg.set_rotation_naming_scheme(quill::RotatingFileSinkConfig::RotationNamingScheme::DateAndTime);
cfg.set_max_backup_files(2);

Expected Behaviour
Older log files continue to be deleted/overwritten, and the amount of logs from this app/sink present in the directory where logs are being saved should never exceed max_backup_files plus 1 (for the current one)

Environment Details

  • Library Version: 10.2.0
  • Operating System: Behavior is the same across platforms (tested windows 11, ubuntu 24.04, debian testing)
  • Compiler: VS2022, VS2026, gcc15

Additional context
If this is intended/desired behavior, is there any way to achieve the behavior I'm describing as expected instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions