Click here to Skip to main content
15,880,608 members

Comments by netogg (Top 3 by date)

netogg 19-Sep-13 11:58am View    
Sorry, didn't want to be rude, I'm just ignorant. I might not have phrased my problem accurate enough. I'll sweat some more about it, and might ask a better question if necessary. Thank again though.
netogg 14-Oct-11 19:49pm View    
At the moment I have:

// *** log creation rules ***
// - must have admin right on Windows Vista and up
// - only first eight chars are discriminating and must be unique
// - will automaticalle create new log if not existant
// - needs some time to create and refresh, or reboot app
// - cannot be written until created
// - App name == source and must be unique
// - logs go default under Appplication Log
// - since source name must be unique check it before creation otherwise exceptiom
// - source doe not really have to exist as a code file...???!!! -> no
// - also logname must be unique
// - must use system diagnostics namespace
// - must open a new instance of eventlogger to see it; refresh does not work // sometimes it does work? test
// - deletes work direct
// - log to delete must exist first
// - sourcename still exist after log is deleted; reboot required?
// http://msdn.microsoft.com/en-us/library/2awhba7a.aspx for conditions

// Should create the following eventviewer structure:
// Eventviewer
// Application & Services Logs
// ApplicationName
// Service
// UI
// etc...
if (!System.Diagnostics.EventLog.SourceExists("11ApplicationName") && !System.Diagnostics.EventLog.SourceExists("11ApplicationName"))
{
System.Diagnostics.EventLog.CreateEventSource("11ApplicationName", "folder");
System.Diagnostics.EventLog.CreateEventSource("12ApplicationName", "subfolder");
}
netogg 14-Oct-11 12:17pm View    
Unfortunately this does not answer my question. Google produces a lot of similair examples. Indeed I know how to create and write to an Eventlog.

But I want to know specifically how to create different (sub, sub, sub)folders under "Application & Service Logs", in Eventviewer like mentioned in the original question. Just like the "Microsoft" entry.

If I misunderstood you maybe you could write a concrete example?

Thanks for your quick reply.