Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Mar : Writing to custom event log
| Subject: | Writing to custom event log |
| Posted by: | "Lee Griffin" (lgriffin at griffinsoftware dot com) |
| Date: | Fri, 7 Mar 2008 08:12:22 |
I've been trying to figure out how to write to the Windos event log using a
custom event log (i.e. NOT the Application, System or Security logs). I've
found lots of information on Tamaracka, mostly from Gambit, about how to
write to the Application log, but nothing that helps with a custom log.
I've set up the correct registry entries for the custom log and the
application (for the sake of discussion let's say I'm using "MyLog" for the
log name and "MyApp" for the application). To get anything to work at all,
when I call RegisterEventSource, I have to pass it the name of the custom
LOG (i.e. "MyLog"). I can then call ReportEvent and an event will indeed
appear in the Event Viewer under the custom log. However, the log entry
shows that the "source" of the event is "MyLog". I'd like it to be my
application name "MyApp". So, in other words, I'd like to be able to write a
record to the event log under the custom log "MyLog" for the application
"MyApp" so I could have multiple applications (e.g. "MyApp2", "MyApp3")
under the same log. I can't seem to figure out how to do this. Do you have
to set up a separate custom log for each application? If so, they why, when
you create the registry entries, do you have to create an entry for the
custom log and under that an entry for the application if it's not going to
use the application?
Thanks to anyone who can help me understand this.
Lee