Logging - Throw when logging fails

Topics: Logging Application Block
Feb 11, 2012 at 3:09 PM


Hi forum

I want to use Enterprise Library for auditing. The logging is critical for auditing - so I want enterprise library to throw if logging fails. I also want to use enterprise library for logging exceptions. I do not want to throw on failure of error logging - I use multiple listners and expect that one of them will work - it is not critial that all errors are logged - but it is just critical that auditing happens.

How can I configure Enterprise library to throw on error? I would like to be able to be able to set it for a category.

Hope someone can help

Jey

Feb 13, 2012 at 8:01 AM

I don't think there is a way to configure Enterprise Library to throw an error when logging.  If an exception is encountered when logging, then an error (along with the original LogEntry information) is logged to the errors special source.  

The logic to handle exceptions is within the core logging code (LogWriterImpl.cs).  If you wanted to change the behavior you would have to modify the block.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Feb 16, 2012 at 8:15 AM

 

Hi Randy.

Thank you for your reply.

I'm very supprised this is the case. In my view this is a very unfortunate design as it makes enterprise library useless for critical logging.

/JAXN