May 05, 2001

Writing to the Windows NT event log

This helps lot while debugging server/service code -
Windows applications typically write to the NT event log to provide the user with useful information. In VB5/6, the App object now provides methods to make writing to the event log in Windows NT a snap:

'-- Start Event Logging

Call App.StartLogging("", vbLogToNT)

'-- Log Events to NT

Call App.LogEvent("Info", vbLogEventTypeInformation)

Call App.LogEvent("Error", vbLogEventTypeError)

Call App.LogEvent("Warning", vbLogEventTypeWarning)

Check out the Knowledge Base article App.LogEvent Only Logs in Compiled Applications for more information.