Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation with custom time format not working #179

Closed
alboyer opened this issue Oct 19, 2024 · 1 comment
Closed

Rotation with custom time format not working #179

alboyer opened this issue Oct 19, 2024 · 1 comment
Labels

Comments

@alboyer
Copy link
Contributor

alboyer commented Oct 19, 2024

When using a custom timestamp format for rotation naming, the timestamp format is used for the first file but not subsequent files. For example, the following code will produce the log files below.

Logger::with(LevelFilter::Info)
    .rotate(
        Criterion::Age(Age::Second),
        Naming::TimestampsCustomFormat {
            current_infix: None,
            format: "%Y%m%d_%H%M%S",
        },
        Cleanup::Never,
    )
    .log_to_file(FileSpec::default())
    .duplicate_to_stdout(Duplicate::All)
    .start()?;
rotate_20241019_094454.log
rotate_r2024-10-19_09-44-55.log
rotate_r2024-10-19_09-44-56.log
@emabee
Copy link
Owner

emabee commented Oct 22, 2024

Fixed with 0.29.4. Thanks for the PR!

@emabee emabee closed this as completed Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants