Closed mrd0ll4r closed 4 years ago
Hi, thanks for the detailed description, and yes, the long-term proposal makes sense, and I think I can look into it soon :-)
Thank you! That sounds great :)
Implemented with 0.14.7. For details, see https://docs.rs/flexi_logger/0.14.7/flexi_logger/struct.Logger.html#method.cleanup_in_background_thread
Amazing, thank you! :)
Hey! Thanks for writing this library and making it available!
I've run into a problem. I run a project on a raspberry pi, which has a bunch of threads that e.g. poll some attached hardware for changes. For debugging, I log the raw values they get, among other things. All my logs are written to files and everything above warnings is copied to stderr. The problem is this: I set up log rotation, keeping 5 plain-text files and 30 zipped ones. They fill up quite quickly with debug logging on, but that's not surprising. Now, whenever the logs are rotated and an old one is zipped, nothing can log anymore for as long as that takes.
Let me illustrate with a bunch of logs :) This is a fresh start, with no log files, so five plain text files are produced (this doesn't take long), and then later one file is zipped (this takes a while):
I run these things pretty close to their limit, so they're always lagging a bit behind. But note how, after the last rotation, they lag behind a lot. I suspect this is because they tried to debug-log something, but got blocked.
Do you think I got the problem about right?
The obvious solution for me, for now, is to not debug-log (at least in production 😄 ). Long-term: Can we maybe move the zipping to another thread?
Best,