rust-cli / env_logger

A logging implementation for `log` which is configured via an environment variable.
https://docs.rs/env_logger
Apache License 2.0
803 stars 125 forks source link

Can env_logger be used with tokio? #216

Closed jbaublitz closed 3 years ago

jbaublitz commented 3 years ago

Hi! I have been in the midst of tracking down a bug causing a deadlock in a multi-threaded application using tokio. I finally managed to trace the deadlock to stderr locking and as far as I can tell, this is being initiated by the log method by env_logger. After not making much progress on this, I decided to look into the implementation of env_logger's logging method and I see that it uses it a thread_local! variable. From everything I've heard from the tokio maintainers, this could absolutely cause problems. Is env_logger not meant to be used with tokio?

jbaublitz commented 3 years ago

Closing for now. The issue appears to be unrelated.