Reputation: 1
String s = "this is an erro message";
EventLog log = new EventLog("PragimTech");
log.Source = "PragimTech.com";
log.WriteEntry(s , EventLogEntryType.Error);
Response.Write("Successfully written to event viewer");
I've created the custom logger in the event viewer ("PragimTech"), but when I log anything to it, I can't find the message that I sent, i don't know why , and there are no problems or exceptions appearing, but the message couldn't be found at the event viewer.
Upvotes: 0
Views: 88
Reputation: 4794
If the Log Source (PragimTech.com) doesn't exist in the Event Logging system, your Web Application under IIS will try to create the source. However, it's more than likely that your application doesn't have creating a log source access which is causing it to fail.
You have a couple of options:
Upvotes: 1