tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.19k stars 677 forks source link

RollingFileAppender `prune_old_logs()` relies on `metadata().created()` which is not available on all platforms #3027

Open richardstephens opened 2 weeks ago

richardstephens commented 2 weeks ago

Bug Report

Version

tracing 0.1.40 tracing-appender 0.2.3

Platform

Linux dev 6.6.34-0-lts #1-Alpine SMP PREEMPT_DYNAMIC Mon, 17 Jun 2024 10:01:45 +0000 x86_64 Linux Alpine 3.20.0 Rust 1.78.0

Description

The rolling file appender's prune_old_logs() function calls metadata.created().ok()? which does not work on Alpine Linux.

called `Result::unwrap()` on an `Err` value: Error { kind: Unsupported, message: "creation time is not available on this platform currently" }

This causes log files to accumulate forever.

kaffarell commented 2 weeks ago

Duplicate of #2999.