How to update file path of the `WriteLogger` after I call `CombinedLogger::init`?
yaoxin-jing opened this issue · 2 comments
yaoxin-jing commented
After the global logger is set to WriteLogger with file path /a/b.
Is it possible to update the file path and let the logger log message to another file /a/c?
Drakulix commented
This is not possible with simplelog out of the box.
You could implement your own SharedLogger, that just wraps a WriteLogger inside an Arc<Mutex<_>>. Then you could exchange the logger in there at runtime to switch logging to a different file.
yaoxin-jing commented
many thanks, problem resolved