, .NET, EventLog ( System.Diagnostics), Windows.
:
using System.Diagnostics;
class LogSample{
public static void Main()
{
if (!EventLog.SourceExists("ApplicationLog"))
{
EventLog.CreateEventSource("ApplicationLog", "SampleLog");
}
EventLog log = new EventLog();
log.Source = "ApplicationLog";
log.WriteEntry("Some error entry goes here", EventLogEntryType.Error);
log.Close();
log.Delete("ApplicationLog");
}
}