Event log messages are overloaded by another event log
I am creating event logs to log errors of an asp.net project. I do this by adding a key to regedit and then a subkey.
Sometimes I create a new key and turnkey, and instead of getting a new empty event log, I see in the event viewer that it is showing me logs from another project. I can't find a pattern as to when this will happen.
Has anyone encountered such a problem? Am I doing something wrong?
0
source to share
2 answers
You probably want to use EventLog.CreateEventSource for this - it should take care of any details for you.
A quick reading through the docs seems to show that the first 8 characters are checked for uniqueness ... maybe where is your problem?
Edit: From the Reflector API does this ...
- Check for invalid characters ("unprintable" based on Unicode category, \, * ,?)
- Checks that the generated registry key is <= 254 characters
- Checks if the source is registered
- Checks that the log name is not reserved (AppEvent, SecEvent, SysEvent)
- Checks for another log with the same 8 character start
- Checks that the log name does not exist as a source
- Creates a log subsection
- Initializes the log subkey with default values (MaxSize = 524288, AutoBackupLogFiles = 9. Save = 604800, File =% SystemRoot% \ System32 \ config \ filename .Substring (0, 8) + ".evt")
- If the OS is not> Windows NT 5.x (Vista or higher), a multi-line value is generated in the log with the log name and source name. Or, if the value exists, appends the source name to the existing array.
- Creates a subsection for the source
- Initializes the source subkey with default values (EventMessageFile, ParameterMessageFile, CategoryMessageFile, CategoryCount)
+3
source to share