I want to create a new Event log to the windows service EventLog and add new logs to it.
By default,the event logs are Application,System and Security but I want to
add a new one.
I could successfully add logs to the Application event log using
RegisterEventSource and ReportEvent functions but I could not find how
to create a new Event log. All the forums discuss this issue using .NET
framework, but I do not want to add the libraries of the .NET.
I have successfully created a key in the registry, named MyAppDiagnostics, under the tree:
HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> Eventlog
The MyAppDiagnostics contains the key MyApp which has the EventMessageFile and the TypesSupported values. So, the tree is actually:
HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> Eventlog -> MyAppDiagnostics -> MyApp
Then, I run the RegisterEventSource(NULL, "MyApp") but there is no new entry log with the MyAppDiagnostics name is created. Also, when I fire new events, these are added in the Application entry log according to Event Viewer.
How can I create the MyAppDiagnostics entry log and how can I fire events in this entry?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.