0

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.

Franky Brandt
  • 193
  • 1
  • 11
  • How are you logging your events to EventViewer? Are you using `ReportEvent()`, `TraceEvent()`, `EventWrite...()`, `TraceLoggingWrite()`, ...? Not all logging systems support what you are asking for. Since you mention the `EventLog` Registry key, then I'm assuming you are using the oldest of them, `ReportEvent()`, is that right? It doesn't support writing events to sub-logs within an application. Everything you need to know about logging events is in Microsoft's documentation: [Windows Events](https://learn.microsoft.com/en-us/windows/win32/Events/windows-events) – Remy Lebeau Aug 10 '23 at 14:58
  • Most of the logging is done in Windows service applications using the .LogMessage method, but that could be changed if that doesn't support the subkeys system. – Franky Brandt Aug 10 '23 at 19:04

1 Answers1

1

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'

Franky Brandt
  • 193
  • 1
  • 11