26 namespace Ntp.Common.Log
31 : base(threshold, true)
36 private const string Log =
"Application";
38 private readonly
string name;
68 if (severity < Threshold)
71 WriteEventLogEntry(text, GetEventLogEntryType(severity), 0);
79 if (severity < Threshold)
85 if (severity < Threshold)
88 WriteEventLogEntry(exception.ToString(), GetEventLogEntryType(severity), 0);
93 WriteEventLogEntry(exception.ToString(), EventLogEntryType.Error, 1);
96 #region EventLog Implementation 102 if (!global::System.Diagnostics.EventLog.SourceExists(name))
104 global::System.Diagnostics.EventLog.CreateEventSource(name, Log);
107 catch (SecurityException)
120 return EventLogEntryType.Information;
122 return EventLogEntryType.Warning;
124 return EventLogEntryType.Error;
126 return EventLogEntryType.Error;
134 global::System.Diagnostics.EventLog.WriteEntry(name, text, type, code);
136 catch (SecurityException)
static EventLogEntryType GetEventLogEntryType(Severity severity)
override void WriteLine(Exception exception)
EventLog(string name, Severity threshold)
void WriteEventLogEntry(string text, EventLogEntryType type, int code)
override void WriteLine(Exception exception, Severity severity)
override void WriteLine(string text, Severity severity)
override void Initialize()