Closed JohnAllen closed 7 months ago
I think a fairly reasonable approach would be to create your own implementation of LogWriter
, which holds itself as many FileLogWriter
s as you need, and dispatch the LogWriter methods according to your needs. The dispatching based on the String would happen in the write method. You then configure flexi_logger
with Logger::log_to_writer
.
I just tried instantiating two loggers...
The log
crate does not allow instantiating more than one logger. The dispatching thus has to happen within the logger.
First off thank you for writing this and making it public.
Does this library support logging to multiple files based on a string? Something like the Bar example in examples but multiple different filters.
I just tried instantiating two loggers with different FileSpec.basenames and it threw an error, so it seems like not.
To be clear I mean piping multiple
info!
s to different files.