tokio-rs / tracing

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

Compatible with crate daemonize? #2047

Open zaid3tech opened 2 years ago

zaid3tech commented 2 years ago

Hi, I want to use tracing for a daemon process in a file, as soon as daemonization process is started, no tracing in file is logged.

hawkw commented 2 years ago

I'm not personally familiar with the implementation details of the daemonize crate, but as far as I can tell, there shouldn't be any reason why it shouldn't work. Has the file you want to log to been created, and has stdout been redirected to the file using the daemonize crate?

Also, can you confirm that you have a tracing configuration that logs the expected output when the daemonize crate is not used? You could try commenting out the call to Daemonize::start(), and seeing if the expected logs are printed to stdout?