Hi Dominik, Thanks for taking the time to reply. I see where you are coming from but I don't think a filter is what I am looking for. Firstly I could probably use an existing filter like log4net.Filter.MdcFilter<http://logging.apache.org/log4net/release/sdk/log4net.Filter.MdcFilter.html> to achieve what you are suggesting but the problem is I would need to buffer huge volumes of other users messages in order to be confident that the user who is in an exceptional state still had all their messages in the buffer.
Instead, I think I need some sort of buffer per request that the appender uses when the ERROR condition is satisfied, however I am unsure if log4net's architecture would allow me to do this? Anyone else had any experience trying to do something similar? Thank you for your help in advance! From: Dominik Psenner [mailto:[email protected]] Sent: 07 August 2012 12:09 To: 'Log4NET User' Subject: RE: Lossy logging on a per user basis for a high traffic website Hi Joe, I would recommend You to implement a filter that matches your requirements by implementing the IFilter interface or - even better - by subclassing FilterSkeleton. Cheers, Dominik ________________________________ From: Joe Udwin [mailto:[email protected]]<mailto:[mailto:[email protected]]> Sent: Tuesday, August 07, 2012 12:44 PM To: '[email protected]' Subject: Lossy logging on a per user basis for a high traffic website I'm looking to setup lossy logging (on a high traffic website) on a per user (or per request) basis. E.g The application logs nothing until an error occurs when all logs are then written to a file (or db). I have been playing around with the BufferingForwardingAppender but it looks like it buffers all logs sent to it (not per thread or per request), so on a high traffic site this could be a combination of multiple user's log messages. On a busy site other users log messages could completely push the useful logs out of the buffer. Has anyone done anything similar? Are people using lossy logging on a high volume website? Would you recommend this approach? Any ideas how I might achieve this? Thank you for your help in advance!
