Skip to content

Simple Delphi class making it easier to write to the Windows Event Log

License

Notifications You must be signed in to change notification settings

Kobus-Smit/EventLogHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventLogHelper

Simple Delphi class making it easier to write to the local machine's Windows Event Log.
//----------------- EXAMPLE USAGE: ---------------------------------

uses
  EventLog;

procedure TMainForm.EventLogExampleButtonClick(Sender: TObject);
begin
  TEventLog.Source := 'My Test App Name';

  TEventLog.WriteError('This is an error.');
  TEventLog.WriteInfo('This is information.');
  TEventLog.WriteWarning('This is a warning.');
end;

Also includes a ready to use message file (More info)

and a procedure to register your event source (More info)

procedure TMainForm.RegisterEventSourceButtonClick(Sender: TObject);
begin
    // This requires admin rights. Typically called once-off during the application's installation
    TEventLog.AddEventSourceToRegistry;
end;

See also http://stackoverflow.com/questions/30229826/writing-to-the-windows-event-log-using-delphi

Tested in Delphi XE and XE7

About

Simple Delphi class making it easier to write to the Windows Event Log

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published