Closed redzic closed 2 years ago
I'm planning an option to configure the output channel for flexi_logger
's own error messages, like the one above. With that, you could direct these messages e.g. to a file, or to /dev/null. Would that be good enough?
I should clarify that this only happens when the log file is supposed to be located in a directory that does not yet exist
This is strange - flexi_logger
usually creates the missing folders. This is also tested regularly. Is there some authorization issue that prevents the process from creating the folders?
Silencing errors is now possible now with 0.20.1, using .error_channel(ErrorChannel::DevNull)
Thanks! Sorry for the somewhat late response, but yeah that is a good solution to me. Also I sort of was able to fix it, but short story is that apparently if the log file failed to be created initially, (I guess) flexi_logger doesn't try again after that which was the source of our errors (a different error where the log file wasn't created at all).
Thanks for this great crate!
I have a use case where my log file isn't created until some time, and flexi_logger writes to both the logger and to stderr. While the file is not created yet, I would like for flexi_logger to log to just stderr and ignore the errors for the main log file not being created yet. While this is working perfectly, flexi_logger displays an error message every time something is logged, which looks like this:
I think it would be great if there was some way to manually handle these errors rather than it always be printed to stderr. I should clarify that this only happens when the log file is supposed to be located in a directory that does not yet exist. If the parent directory does exist, then everything works completely fine.