Where is the event log ?

  • Thread starter Thread starter Anders Both
  • Start date Start date
A

Anders Both

If i write to the event log like this:

EventLog.WriteEntry("myPro","Applcation_Starty",EventLogEntryType.Informatio
n);

Where can i then see a list of thesse event, if i go into the event log in
computer management they are not there i think. Do i have to add a new log
file or something?

?

Best Regards,

p.s. I am writing to the event log from within the asp.net process, but i
added the asp.net acount to power users, so i thing it will be the same as
for a normal windows form.
 
If i write to the event log like this:

EventLog.WriteEntry("myPro","Applcation_Starty",EventLogEntryType.Informatio
n);

Where can i then see a list of thesse event, if i go into the event log in
computer management they are not there i think. Do i have to add a new log
file or something?

?

Best Regards,

p.s. I am writing to the event log from within the asp.net process, but i
added the asp.net acount to power users, so i thing it will be the same as
for a normal windows form.


Hi there,

Here's what I think you need to do:
1. Create an EventLog object reference,
2. Set the source for your entry.


The EventLog constructor has several forms, so play around...
Eg (at it's simplest):

//===================
EventLog elog = new EventLog();

if (!EventLog.SourceExists("Test App")) {
EventLog.CreateEventSource("Test App", "Application");
}
elog.Source = "Test App";
elog.WriteEntry ("Testing", EventLogEntryType.Error);
 
Back
Top