"Safe" event source to write to

  • Thread starter Thread starter Kevin C
  • Start date Start date
K

Kevin C

Is there a safe Application log event source? By safe, I mean one that will
always exist (excluding any manual deletion) on any and all normal xp, 2003
installations. I thought "Application" was one but apparently its not.

Kevin
 
Kevin,

There is no reason you can not make it safe. Why not write a method
which takes the name of the log, and the event to write, and check to see if
it exists before trying to write it? If it doesn't exist, do nothing,
otherwise, write it.

Hope this helps.
 
I think I worded this wrong. What I am looking for is a string value ; e.g.
"Application Exception", that represents a pre-installed event source on a
normal XP, 2003 installation. In other words, if the permission trying to
create my custom event source fails, I want to fallback and use an event
source that I am 99% am guaranteed is on the machine. Therefore, I can log
the fact that the permission failed but still get my message into the event
log. Does this make more sense?

Kevin


Nicholas Paldino said:
Kevin,

There is no reason you can not make it safe. Why not write a method
which takes the name of the log, and the event to write, and check to see if
it exists before trying to write it? If it doesn't exist, do nothing,
otherwise, write it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Kevin C said:
Is there a safe Application log event source? By safe, I mean one that
will
always exist (excluding any manual deletion) on any and all normal xp,
2003
installations. I thought "Application" was one but apparently its not.

Kevin
 
Back
Top