I want to see about logging events from a Delphi 5 application to the Windows log, and from another post here I see that I can use the TEventLogger
class to do this.
However, I can't find any documentation on the syntax of the TEventLogger.LogMessage
procedure, so I don't know what all the parameters mean, how to use them, or even what possible values are available.
I've tried looking around, and all I find is a page from Embarcadero stating that the function exists, but nothing on its syntax, and MSDN is no help as I can only find the BizTalk version which does me no good.
Does anyone have a help page or information on this that might shed some light on what I can do with it?
TEventLogger
is an internal helper class forTService
.You log message using the
TService.LogMessage()
function, not by calling intoTEventLogger
directly. The parameters ofLogMessage()
directly match with the parameters of the Win32 APIReportEvent()
function.Look in the Win32 API documentation for details.
If you are not writing a service application, then you need to call the Win32 API
RegisterEventSource()
andReportEvent()
functions directly instead.A simple example of an application writing to the event log:
But beware that not registering the EventID with the system will give this kind of confused Description: