Archive for July 6th, 2009

Writing to the Windows Event Log

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.

Add comment July 6, 2009


Calendar

July 2009
M T W T F S S
    Sep »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Posts by Month

Posts by Category