tokio-rs / tracing

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

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

Open richardstephens opened 4 months ago

richardstephens commented 4 months 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 4 months ago

Duplicate of #2999.