G
Gary
I am trying to write to a event log using the EventLog Class in a ASP.net
application.
The following code was added to 'Aplication_Error' subroutine in the
'Global.asax' file
Public Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ErrorDescription As String = Server.GetLastError.ToString()
'Creation of event log if it does not exist
Dim EventLogName As String = "ErrorSample"
If Not EventLog.sourceExists(EventLogName) Then
' Problem1 Error Message = SourceExists is not a member of
EventLog
EventLog.CreateEventSource(EventLogName, EventLogName)
' Problem2 Error Message = CreateEventSource is not a member of
EventLog
End If
'Inserting into eventlog
Dim Log As New eventlog()
Log.Source = EventLogName
Log.WriteEntry(ErrorDescription, EventLogEntryType.Error)
End Sub
I am using Microsoft Development Environment 2002 version 7.0.9466 &
Microsoft.NET framework 1.0 version 1.0.3705
Please suggest some solution to the above problem.
TIA,
Gary
application.
The following code was added to 'Aplication_Error' subroutine in the
'Global.asax' file
Public Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ErrorDescription As String = Server.GetLastError.ToString()
'Creation of event log if it does not exist
Dim EventLogName As String = "ErrorSample"
If Not EventLog.sourceExists(EventLogName) Then
' Problem1 Error Message = SourceExists is not a member of
EventLog
EventLog.CreateEventSource(EventLogName, EventLogName)
' Problem2 Error Message = CreateEventSource is not a member of
EventLog
End If
'Inserting into eventlog
Dim Log As New eventlog()
Log.Source = EventLogName
Log.WriteEntry(ErrorDescription, EventLogEntryType.Error)
End Sub
I am using Microsoft Development Environment 2002 version 7.0.9466 &
Microsoft.NET framework 1.0 version 1.0.3705
Please suggest some solution to the above problem.
TIA,
Gary