Most of us start using logging with the output of DEBUG messages. When the project runs for a while usually we reduce the output to INFO or even WARN levels.
But when an error occurs I just miss that DEBUG-Messages before the error came up. So this is what I want:
Just log from INFO or above. But when an error occurs I also want the DEBUG-messages that appeared before. Is there an appender or code snippet to achieve that?
Log4net has an appender for just this purpose: ´BufferingForwardingAppender´.
This tutorial contains everything you need: http://www.beefycode.com/post/Log4Net-Tutorial-pt-8-Lossy-Logging.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With