473,413 Members | 1,731 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Event log property doesn't retain setting changes..

KC
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


Nov 15 '05 #1
1 1873
KC
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".
"KC" <ch*****@hotmail.com> wrote in message
news:OH**************@tk2msftngp13.phx.gbl...
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

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
2
by: TF | last post by:
hi, i am using a ListBox control on a windows form using VB.Net. when i set the DataSource property of the control to an ArrayList it fires following events in this order: SelectedIndexChanged...
1
by: KC | last post by:
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...
4
by: Suzanne | last post by:
Hi all, I'm having problems with datagrids and the currentcellchanged event. My problem is this: I have a datagrid on a form, if the user changes the text in a cell on the datagrid then tries to...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
1
by: David Veeneman | last post by:
I am writing a control that relies on its host to validate the contents of one of its fields. The control fires a custom 'FooNeedsValidating' event and passes the field's data with the event. The...
6
by: tbrown | last post by:
I have a combobox with items like this: {one,two,three}. The selected index is 0, so "one" appears in the combobox text. When the user drops down the list, and selects "two", for example, I...
12
by: Marc | last post by:
Hi, How can i increase the mousehover event timer? AddHandler NewBtn.MouseHover, AddressOf Shownotes Private Sub Shownotes(ByVal sender As System.Object, ByVal e As System.EventArgs)...
3
by: =?Utf-8?B?Ulc=?= | last post by:
I constructed a new Class with some private members. I would like an event to be raised on the moment the value of one of those private members is changed. How do I define an event for that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.