By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

Events are being logged to the "Application" log instead of custom log

P: 1
Hi Pros,

I have a weird problem here. I am logging from my .NET app to a custom log, but unfortunately, the events are redirected to the Application log. I am sure that I am specifying the log name and the source name accurately. I am using some code like the following:

Expand|Select|Wrap|Line Numbers
  1. EventLog ev = new EventLog(myLog);
  2.  
  3.             if (EventLog.SourceExists(mySource))
  4.             {
  5.                 if (EventLog.LogNameFromSourceName(mySource) != myLog)
  6.                 {
  7.                     EventLog.DeleteEventSource(mySource);
  8.                     EventLog.CreateEventSource(mySource, myLog);
  9.                 }
  10.             }
  11.             else
  12.             {
  13.  
  14.                 EventLog.CreateEventSource(mySource, myLog);
  15.             }
  16.             ev.Source = mySource;
  17.  
  18.             ev.WriteEntry(message, EventLogEntryType.Error);
HELPPPPP!
Feb 6 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.