Anas Mousa
Anas Mousa

Reputation: 23

Event Log name is other than "Application" but logs are written in "Application" Log

In my VB.NET application, I created a new Event Log Name named "My_Log", and I have this application run for a number of different situations where each situation is named by a unique name, and on logging, I create new Event Sources with these unique name on my new log using the function:

EventLog.CreateEventSource("My_1st_Source, "My_Log")

Now, all my logs are written in my log but 3 or 4 of them! they're written on "Application" Log.

I tried using EventLog.LogNameFromSourceName("My_1st_Source", Environment.MachineName)on all my situations (with all different event sources' names) to see that they are under my log "My_Log", and they all gave me the same result that they are under my log name; but some of them are still appearing in "Application" Log.

Why is that happening? and is there any way to get all my logs under my log name? Thanks.

Upvotes: 1

Views: 1322

Answers (1)

Ryan M
Ryan M

Reputation: 2112

You might want to try restarting your computer if you have ever mapped these sources to the Application log. According to http://msdn.microsoft.com/en-us/library/2awhba7a.aspx,

If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.

Upvotes: 1

Related Questions