16,004,833 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.