web analytics

Category: .NET

.NET, ASP.NET

Add an entry to event log in C#

EventLog is a good place to write your applications log. Here is an example to show how to do this: If ( !EventLog.SourceExists("TestCategory")) EventLog.CreateEventSource("TestCategory","TestLog"); EventLog evtLog = new EventLog(); evtLog.Source…