"yaron" <ya...@discussions.microsoft.com> wrote in message
news:577A2AD8-B3F8-42EF...@microsoft.com...
The following is one of the standard tool for logging in C#...
Log4net is a tool to help the programmer output log statements to a variety
of output targets. log4net is a port of the excellent log4j framework to the
.NET runtime.
eventLog1 = new System.Diagnostics.EventLog();
if (!System.Diagnostics.EventLog.SourceExists("Transaction Service"))
{
System.Diagnostics.EventLog.CreateEventSource("Transaction Service",
"Transaction Log");
}
eventLog1.Source = "Transaction Service";
The following code actualy adds an event to the created log.
eventLog1.WriteEntry("MyWindowsService_CSharp Started",
EventLogEntryType.Information);
--
Marinus Holkema
http://marinusholkema.blogspot.com/