Delphi component wrapper for NT event logging API
This non-visual component is a wrapper for the Windows NT event logging API.
To use:
- Place it on a form or datamodule (you only need one event log component per
project)
- Set the "AppName" property to a meaningful representation of your application
name. This name appears in the logged message data.
- Call the "InitLogin" method at the start of the application - the form create
is a good place. This method creates the required registry entries for event
logging (if they are not present already) and initialises the event logging
API.
- Call the methods "LogError", "LogWarning" and "LogInfo" to create event log
entries at the required level of severity.
The two methods "CreateRegEntry" and "DeleteRegEntry" can be used to manually
register the application for event logging in the registry and clean the
registry entries up when they are no longer used (i.e. the application is
uninstalled).
You can download the full Delphi source code here