Title Property in Exception Handling - Logging

Topics: Exception Handling Application Block
Jul 31, 2012 at 9:22 AM
Edited Jul 31, 2012 at 9:22 AM
i have the following exception handler:
<add name="Exception" type="System.Exception, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"
              <add name="DB Logging Handler" 
                   type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging"
                   eventId="9001" severity="Error" title="XXX" priority="5"
                   formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
                   /> . . . 
The question is : can i make the title property title="XXX" take an exception error message instead the fixed string XXX
for example title="{message}" is that possible ?
Jul 31, 2012 at 3:07 PM

No, there is not out of the box way to dynamically change the title (or other properties) of the Logging Exception Handler.  You could create a custom Exception Handler (you could reuse most of the LoggingExceptionHandler source code) to do what you want.  See the Enterprise Library 5.0 - Extensibility Labs for a walk-through on creating a custom exception handler.

Randy Levy
Enterprise Library support engineer