Formatters (Additional Information)

Topics: Exception Handling Application Block, Logging Application Block
Aug 13, 2007 at 10:44 PM
I'm currently exploring the Enterprise Library Configuration utility. I'm interested in using Exception/Logging in a Windows service that I'm building. One feature I'd like to include is the ability to pass some additional information into my logging.
For example. When the service starts it performs a lookup of a location ID from a SQL database. This is stored in a public property. If there is an exception throw within the service I write the exception out to a web service for logging. One of the parameters passed is the location ID.

I'm wanting to add logging to the event log and also the local SQL DB. In my text formatter I was hoping I could pass the Location ID somehow that I have in a public property.

Might anyone have any suggestions. So far my research is not producing results.
Aug 14, 2007 at 1:01 PM
Hi,

The logging handler will attempt to build a message to log that includes the values for all the public properties in the handled exception, so assuming the exception does have such a property the information should be already being logged. Is this what you are looking for?

Fernando
Aug 14, 2007 at 8:04 PM
I believe what I'm really looking for is an example of the proper way to create a custom formatter.