Writing to the Windows Event Log
July 6, 2009
Writing errors to the Windows event log can be tricky, especially with permissions on custom folders. Here’s a simple method that won’t require special permissions
using System.Diagnostics;
…
EventLog log = new EventLog();
log.Source = “Application”;
log.WriteEntry(“Your Message”, EventLogEntryType.Error);
If you’re capturing web service exceptions, be sure to capture the SoapException and write the Detail xml node.
Entry Filed under: Programming. Tags: Debugging.
Trackback this post | Subscribe to the comments via RSS Feed