When compiled with --target=x86_64-unknown-linux-musl
, log rotation doesn't work. That is caused by:
- The file creation time cannot be retrieved when compiled with musl. https://users.rust-lang.org/t/musl-and-file-creation-time/111559
- 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.)