Last post Nov 10, 2009 02:10 PM by jerrylefou
Nov 10, 2009 10:31 AM|firsttarf|LINK
Until now I have been using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling version 4.1 to write to the Windows event log. Now I'd like to have each error write to a database. What do I do to write the exceptions to MS SQL?
I am looking at Microsoft.Practices.EnterpriseLibrary.Logging.Database, but I am not sure what to do with it. I have looked at the individual hands on labs but do not see how to have exception handling go anywhere o
Nov 10, 2009 02:10 PM|jerrylefou|LINK
You have to write your own Publisher. Create a class that implements IExceptionPublisher and then write some code in the publish method to write the exception details in your database. Finally, you will have to add your publisher in your config file (web.config)
and set it to On.
hope that helps!