Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
CodeDelphiTech Partner

Ultra-Fast Way To Retrieve Event Logs In Your Delphi App With Robust Component Suite


Developers may often need to retrieve the windows event messages to diagnose system problems and predict future issues. How to retrieve event logs programmatically for the given source such as System, Security, Hardware events, etc. ? Don’t know how to do? Don’t worry?  MiTec’s System Information Management Suite’s component helps to retrieve event messages quickly and with less code. we will learn how to use use the TMiTec_EventLog, component in this blog post.

Platforms: Windows.

Installation Steps:  

You can easily install this Component Suite from GetIt Package Manager. The steps are as follows.

  1. Navigate In RAD Studio IDE->Tools->GetIt Package Manager->select Components in Categories->Components->Trail -MiTec system Information Component Suite 14.3 and click Install Button.
  2. Read the license and Click Agree All. An Information dialog saying ‘Requires a restart of RAD studio at the end of the process. Do you want to proceed? click yes and continue.
  3. It will download the plugin and installs it. Once installed Click Restart now.

How to run the Demo app: 

  • Navigate to the System Information Management Suite trails setup, Demos folder which is installed during Get It installation e.g) C:UsersDocumentsEmbarcaderoStudio21.0CatalogRepositoryMiTeC-14.3DemosDelphi12
  • Open the ELView project in RAD studio 10.4.1 Compile and Run the application.
  • This Demo App shows how to retrieve event logs programmatically for the given source and details of the particular event message.

Components used in MSIC ELView Demo App:

eventlogproperties 5888241
<strong>MiTeC EventLog Properties<strong>
  • TMiTeC_EventLog: Retrieves Windows Event Log messages for given source.
  • TComboBox to list the Event Source category such as System, Security, Hardware events.
  • TEdit to provide the filter text which helps to filter user preferred the event log messages
  • TListView to list the event log messages for a particular source.
  • TButton’s to save and refresh.

Implementation Details:

  • An instance is created EL of TMiTeC_EventLog, and source event source containers is retrieved by looping the ContainerCount property. Use OnReadEventLog to update the application message caption for each 1000 event messages.
  • SourceFilter property helps filter the text within the event log messages. Set this property with TEdit Text value.
  • On changing the combo box, list the event logs by looping the RecordCount, For each record of TLogRecord type provides the EventType, DateTime, Source, Category, EventID, Username, Domain, Computer, Description, BinaryData, CharData values.
  • You can provide the Username, Password, DomainName for connecting to remote machine for the new WinEvt API.
  • Show the selected items subitem in the Memo text.
eventlog 9223731
<strong>MiTeC EventLog Demo<strong>

It’s really that simple to retrieve event logs and its event log message details from various event source in your application. Use this MiTeC component suite and get the job done quickly.

Head over and check out the full MiTec System Information Management Suite for Access System Information for Windows in Delphi Applications

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.