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 / Distributed Applications / February 2004

Tip: Looking for answers? Try searching our database.

Event log property doesn't retain setting changes..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KC - 06 Feb 2004 17:49 GMT
Hi,
I created a new event log source and log and user WriteEntry to enter the
log as follows:

' Create the source, if it does not already exist.
       If Not EventLog.SourceExists("MySource") Then
           EventLog.CreateEventSource("MySource", "MyNewLog")
      End If

       ' Create an EventLog instance and assign its source.
       Dim myLog As New EventLog()
       myLog.Source = "MySource"

       ' Write an informational entry to the event log.
       myLog.WriteEntry("Writing to event log.")

When I "Right Click" the log and change the property and close, it doesn't
retain the change. For example; If I change the Log size property from
"Overwrite in 7 days" to "Overwrite events when needed", it changes back to
"Overwrite in 7 days." etc..
Am I doing something wrong in the code..

Thanks in advance,
KC
KC - 11 Feb 2004 19:57 GMT
I thought, I would reply to this myself . Unless, any one of you have found
other wise, Turns out, you need to change the "maximum log size" setting as
well when you change the "overwrite" property. If you do so, it will retain
the changes. But, if you just change the "overwrite" options, it doesn't
retain it. This is only TRUE if you create your own "source" and "log".

> Hi,
> I created a new event log source and log and user WriteEntry to enter the
[quoted text clipped - 20 lines]
> Thanks in advance,
> KC

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.