Delphi: Log to Eventviewer using subkeys

99 Views Asked by At

one of the things i have been wondering for years...i hope someone can shed a light.

If you look at Logs applications and services in Windows eventviewer you will see some are using a key a folder type entry with subkeys.

Like 'Intel', 'Microsoft' and 'OpenSSH' in my case.

enter image description here

In my current system in am logging to eventviewer in a own key but all my services and applications log to that same entry. I would prefer that i have a key with the name of the company (like 'OpenSSH' in the example) and subkeys for each of the applications that log to eventviewer.

Like Logs Applications and services CompanyName Application1 Service1 Application2 I have read many many pages with info but can't figure out how this can be done i know the current system is to have keys and subkeys in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog registrykey with 'EventMessageFile' and 'TypesSupported' values but i can't figure how to handle the subkeys.

1

There are 1 best solutions below

0
Franky Brandt On

Finally found how to create the eventviewer keys, the C# example in this link works Creating an eventlog in a folder , which was based on Create Event Log in Sub Directory under Applications and Settings Logs

I managed to create a Delphi app that creates the same registry keys and the needed values now. Now i'm going to try and find a ReportEvent/LogMessage function that can log to these 'channels'