EventViewer using

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have 2 questions :
1)i tried to use this code :
Public Sub Write2EventViewer(ByVal errorMessage As String)

Dim strSource As String = "MyWebSite" 'name of the source
Dim strLogType As String = "Application" 'type of the log 'Application
Dim strMachine As String = "." ' //machine name


If EventLog.SourceExists(strSource, strMachine) = False Then

System.Diagnostics.EventLog.CreateEventSource(strSource,
strLogType)

End If
Dim MyLog As New EventLog(strLogType, ".", strSource)

MyLog.WriteEntry(errorMessage, EventLogEntryType.Warning)
End Sub

in the begining i assume i did some mistake and now the error instead of
appearing under Application ,with source=MyWebSite
i have a new log EVENT under application which called MyWebSite
and the error are written to there.
how can i fix this so it will appear under application?
2)how can i create a dll from this code and use it in my asp.net web site
project?

thnaks in advnace
peleg
 
Back
Top