Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / October 2007

Tip: Looking for answers? Try searching our database.

Need to change defaults for CreateEventSource()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken Varn - 12 Mar 2007 17:03 GMT
The EventLog.CreateEventSource() call creates an event source in Event
Viewer if it does not exist.  However, the defaults that it uses for the
Event Source settings are not desirable for my application.  In particular,
I would like to have the "Overwrite Events as Needed" option set instead of
the "Overwrite Events older than 7 days" option set upon creation.  Is there
a way to change this default setting programmatically in native .NET without
having to manually go into Event Viewer and change it?

Signature

-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------

Michael Nemtsev - 12 Mar 2007 20:05 GMT
Hello Ken,

U can use  Event Log Management Script tool  for this
http://support.microsoft.com/default.aspx?scid=kb;en-us;318763

---
WBR,  Michael  Nemtsev [C# MVP].  
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

Kn> The EventLog.CreateEventSource() call creates an event source in
Kn> Event Viewer if it does not exist.  However, the defaults that it
Kn> uses for the Event Source settings are not desirable for my
Kn> application.  In particular, I would like to have the "Overwrite
Kn> Events as Needed" option set instead of the "Overwrite Events older
Kn> than 7 days" option set upon creation.  Is there a way to change
Kn> this default setting programmatically in native .NET without having
Kn> to manually go into Event Viewer and change it?
Kn>
Kn> EmailID = varnk
Kn> Domain = Diebold.com
Kn> ----------------------------------
Nate Bolam - 10 Oct 2007 22:01 GMT
Look at the EventLog.ModifyOverflowPolicy method. Set it to OverflowAction.
OverwriteAsNeeded for your custom log.

http://msdn2.microsoft.com/en-us/library/system.diagnostics.eventlog.
modifyoverflowpolicy.aspx

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.