Event Viewer - Write to Specific Log File

Harkon

Newcomer
Joined
Jan 4, 2005
Messages
5
Greetings to all,

I am logging my errors in Windows' Event Viewer.
However I would like to be able to write these logs
in a different (custom) Log File instead of the native 'Application'
log file.

Is that possible? Could someone give a hint?

thank you very much
 
Visual Basic:
If Not EventLog.Exists("Your Log Name") Then
    EventLog.CreateEventSource("AppName", "Your Log Name")
End If

Dim log As New EventLog("Your Log Name")
log.Source = "AppName"
log.WriteEntry("Blah")
 
Back
Top