Windows 의 Event Log 서비스에 Event를 기록하는 Logger입니다.
Inheritance: IDisposable
Exemple #1
0
        /// <summary>
        /// 이벤트 로그를 쓴다.
        /// </summary>
        /// <param name="logName">이벤트 로그 명</param>
        /// <param name="source">원본</param>
        /// <param name="message">이벤트 메시지</param>
        /// <param name="type">이벤트 수준(경고, 정보 등)</param>
        /// <param name="eventID">이벤트 ID</param>
        /// <param name="category">이벤트 분류</param>
        /// <param name="rawData"></param>
        public static void WriteEntry(string logName, string source, string message, EventLogEntryType type, int eventID, short category,
                                      byte[] rawData) {
            logName.ShouldNotBeWhiteSpace("logName");

            using(var eventLogger = new EventLogger(logName, EventLogger.DEFAULT_MACHINE_NAME, source)) {
                eventLogger.WriteEntry(message, type, eventID, category, rawData);
            }
        }
Exemple #2
0
        /// <summary>
        /// 이벤트 로그를 쓴다.
        /// </summary>
        /// <param name="logName">이벤트 로그 명</param>
        /// <param name="source">원본</param>
        /// <param name="message">이벤트 메시지</param>
        /// <param name="type">이벤트 수준(경고, 정보 등)</param>
        public static void WriteEntry(string logName, string source, string message, EventLogEntryType type) {
            logName.ShouldNotBeWhiteSpace("logName");

            using(var eventLogger = new EventLogger(logName, EventLogger.DEFAULT_MACHINE_NAME, source)) {
                eventLogger.WriteEntry(message, type);
            }
        }
Exemple #3
0
 /// <summary>
 /// 이벤트 로그를 쓴다.
 /// </summary>
 /// <param name="message">이벤트 메시지</param>
 /// <param name="type">이벤트 수준(경고, 정보 등)</param>
 public static void WriteEntry(string message, EventLogEntryType type) {
     using(var eventLogger = new EventLogger()) {
         eventLogger.WriteEntry(message, type);
     }
 }
 public void DeleteCustomLogTest()
 {
     using (var eventLog = new EventLogger(CustomLogName))
         eventLog.DeleteLog();
 }
        public void CreateCustomEventLogTest()
        {
            var eventLog = new EventLogger(CustomLogName);

            Assert.IsNotNull(eventLog);
        }
 public void WriteTest()
 {
     using (var eventLog = new EventLogger(CustomLogName, EventLogger.DEFAULT_MACHINE_NAME, string.Empty)) {
         eventLog.WriteEntry("Write Test Message", EventLogEntryType.Error, 1, 0);
     }
 }
 public void ClearEventLogTest()
 {
     using (var eventLog = new EventLogger(CustomLogName))
         eventLog.ClearLog();
 }
 public void CreateCustomEventLogTest() {
     var eventLog = new EventLogger(CustomLogName);
     Assert.IsNotNull(eventLog);
 }
 public void DeleteCustomLogTest() {
     using(var eventLog = new EventLogger(CustomLogName))
         eventLog.DeleteLog();
 }
 public void ClearEventLogTest() {
     using(var eventLog = new EventLogger(CustomLogName))
         eventLog.ClearLog();
 }
 public void WriteTest() {
     using(var eventLog = new EventLogger(CustomLogName, EventLogger.DEFAULT_MACHINE_NAME, string.Empty)) {
         eventLog.WriteEntry("Write Test Message", EventLogEntryType.Error, 1, 0);
     }
 }
Exemple #12
0
 /// <summary>
 /// 이벤트 로그를 쓴다.
 /// </summary>
 /// <param name="message">이벤트 메시지</param>
 /// <param name="type">이벤트 수준(경고, 정보 등)</param>
 public static void WriteEntry(string message, EventLogEntryType type)
 {
     using (var eventLogger = new EventLogger()) {
         eventLogger.WriteEntry(message, type);
     }
 }