Skip to content

tracing-appender: log rotation doesn't work with musl target #2999

Open
@zerolfx

Description

@zerolfx

When compiled with --target=x86_64-unknown-linux-musl, log rotation doesn't work. That is caused by:

  1. The file creation time cannot be retrieved when compiled with musl. https://users.rust-lang.org/t/musl-and-file-creation-time/111559
  2. When the creation time of a file cannot be obtained, the file is considered nonexistent.
    let created = metadata.created().ok()?;

Suggestion: Fallback to the modification time when the creation time cannot be retrieved. (Modification time is part of POSIX standard but creation time is not.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions