Imports System.Environment Public Class ErrorUtil 'Exception ¿¡ ´ëÇÑ ³»¿ëÀ» EventLog ¿¡ ±â·ÏÇÑ´Ù Public Shared Sub WriteExceptionIntoEventLog(ByVal objException As Exception) Dim oEventLog As EventLog = New EventLog() 'Server Version ÀÌ µÉ ½Ã ¿¡·¯°¡ ¹ß»ýÇÑ ÄÄÇ»ÅÍ ÆÄ¾Ç Dim strComputer As String = Environment.GetEnvironmentVariable("COMPUTERNAME") If Not oEventLog.SourceExists("BankDotNet") Then oEventLog.CreateEventSource("BankDotNet", "Application") End If oEventLog.Source = "BankDotNet" oEventLog.WriteEntry(strComputer + "ÀÇ " + objException.Source + "¿¡¼­ ¿¡·¯°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù." _ + vbCrLf + objException.Message + vbCrLf + objException.StackTrace, EventLogEntryType.Error) End Sub 'Message ¸¦ ÁöÁ¤µÈ ¼Ò½º·Î ±â·ÏÇÑ´Ù Public Shared Sub WriteEventLog(ByVal Message As String, ByVal Source As String) Dim oEventLog As EventLog = New EventLog() If Not oEventLog.SourceExists(Source) Then oEventLog.CreateEventSource(Source, "Application") End If oEventLog.Source = Source oEventLog.WriteEntry(Message) End Sub End Class