Caching/Buffering log entries

Topics: Building and extending application blocks, Logging Application Block
Feb 13, 2007 at 9:42 AM
I am working on an application that uses the logging application block. I am looking at way to further
extend the block to allow it to buffer logevents before sending as I do not want an expensive database call
for every log event (particularly as the application grows). I have been looking around
for ways to achieve this but there appears to be no standard way of doing so. If anyone can suggest a
place for me to start on this subject (or would like to share thoughts on the matter) it would be much
appreciated, I don’t particularly want to implement my own cache as I imagine that it may become rather
complex due to threading issues..
What may also be useful is if there were some support for transaction management.. Again if anywone has any suggestions..

Thank You,

Feb 14, 2007 at 12:59 AM
One option would be to log to the MSMQ trace listener, and use the MSMQ Distribution Service (on the same or different machine) to process the messages asynchronously to the main app. If you want some kind of buffering/queueing/asynchronicity inside your process you'll need to change quite a bit of code.