Configuring tracing with log4rs or other rolling (and limiting) file appender

Hi there - I'm very interested in using GitHub - tokio-rs/tracing: Application level tracing for Rust., and I know it has its own tracing-appender and tracing-log crates.

At the moment I use the excellent GitHub - estk/log4rs: A highly configurable logging framework for Rust which accepts external configuration and updates when that config is changed (ala Java's logback.xml). It also limits the number of files, deleting those that cross the threshold.

Both of these properties are necessary, and I can't see how to achieve this with the tracing crates because:

  • tracing-appender has a RollingFileAppender but it is unbounded
  • tracing-log seems to want me to write some adapter code

Has anybody travelled this path before and ended up with:

  • tracing
  • config which updates based on external change (either polling an environment variable or reading a file)
  • bounded RollingFileAppender

Thanks!

https://crates.io/crates/rolling-file looks like it might be the ticket...

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.