fern
fern copied to clipboard
Change log file at runtime
Hi,
Is it possible to change the log file(s) (specified using the chain(...)
function on the logger builder) at runtime ? I have looked at the issue #76 (A way to change log level in runtime?
) but I don't think that the proposed solution can be applied to this problem.
There isn't an easy solution to this built in at the moment.
I think this would be a reasonable feature to add to fern
.
In the meantime, you could work around this by building a custom Log implementation which keeps track of the file via a global variable, and by passing that into chain
with .chain(Box::new(GlobalFileLog) as Box<log::Log>)
.