473,938 Members | 3,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

refreshing TraceSwitch settings

I have developed an XML-based tracelistener which uses a booleanswitch
(enable/disable), a general traceswitch (set the tracelevel) and a
userspecific traceswitch (set the tracelevel for a particular user).
Those switches are set in app.config

Now I am looking for a way to know when these settings in my app.config have
changed (for example, when changing the tracelevel) at runtime, so that my
application can use the new settings.
When I check traceSwitch.Lev el in my code while debugging, it seems that it
doesn't use the new level until I restart the application.

Is there a way to "refresh" this dynamically at runtime without having to
restart the application?

My config file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.diagnos tics>
<switches>
<add name="GeneralBo oleanSwitch" value="1" />
<add name="GeneralTr aceSwitch" value="1" />
<add name="UserSpeci ficTraceSwitch" value="4" />
</switches>
<trace autoflush="true " indentsize="2">
<listeners>
<add name="MyTraceLi stener"
type="..."
initializeData= "..."/>
<remove name="Default" />
</listeners>
</trace>
</system.diagnost ics>
<appSettings>
<add key="UserSpecif icTraceUsers" value="User1,Us er2" />
....
</appSettings>
</configuration>
Jul 21 '05 #1
0 1289

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

Similar topics

1
392
by: LRD | last post by:
Form not refreshing after autopostback unless keyboard or mouse move Hi, We created several new ASP.NET C# forms for our intranet. In each form we use panels for different sections of the form that are visible or not depending on what the user is doing. Each particular form.aspx page has a user control on it. This user control contains the form HTML and the C# code.
5
3317
by: Scott Tilton | last post by:
I am having a terrible time getting this to work. I am hoping someone out there can help me with very specific code examples. I am trying to get the linked tables in my Access 97 database to be updated whenever the database opens. I need to have them updated based on an INI file that resides in the same directory as the current database. I do not need or want the ability to open a dialog box to pick the location. I simply want it to...
0
1165
by: emy | last post by:
hello and hye everyone... can i know whether a .dll can read from traceswitch configuration file.I tried for windows application and it work well..because as far as i read, class library(.dll)cannot read from configuration file.So how about traceswitch. thank you
2
2563
by: nhmark64 | last post by:
Hi, When i run testapp.exe the testapp.exe.config file i have in the DEBUG directory gets deleted, and the TraceSwitch in my code never gets set. testapp.exe.config ____________________ <?xml version="1.0" encoding="utf-8"?> <configuration>
0
342
by: Kevin Meiresonne | last post by:
I have developed an XML-based tracelistener which uses a booleanswitch (enable/disable), a general traceswitch (set the tracelevel) and a userspecific traceswitch (set the tracelevel for a particular user). Those switches are set in app.config Now I am looking for a way to know when these settings in my app.config have changed (for example, when changing the tracelevel) at runtime, so that my application can use the new settings. When...
1
3414
by: David | last post by:
I am attempting to use "TraceSwitch " in Win Forms (Below is the code and the app.config). According to the manual, the program should read the config for the setting, but this is not occurring. The examples in the SDK and on the web appear to match mine, but I am not sure if there is an error with my code or some additional setting. ==== The code is:
4
4508
by: WT | last post by:
Hello, Using .NET 2 and visual studio 2005 for writting asmx web services. For asp.net web sites I used to implement trace system using TraceSwitch set in web.config. Using Trace.WireteLineIf(MySwitch.TraceError,"text"); in my code. Having defined TExtWriterTraceListener. But this has no effect and I can't get any tracefile created, is this a limitation of web services ?
0
1113
by: PhilipDaniels | last post by:
I'm trying to create a tracing system for my application. I want to create a new type of Switch that is basically TraceSwitch with an extra attribute called "includeMethodName". So my application's config file should look like this, for example: <configuration> <system.diagnostics> <switches> <add name="FirstSwitch" value="1" includeMethodName="1" /> <add name="SecondSwitch" value="1" includeMethodName="1" />
7
2452
by: raknin | last post by:
I'm using AJAX on my website, but internet explorer does not seem to actually be refreshing the data I retrieve via AJAX when I refresh the page. For example, I have a button that when pressed uses an XMLHttpRequest to go read some data from a database then returns it to the browser for display. It looks like: Press button XMLHttpRequest gets data from db XMLHttpRequest renders returned data in client browser I can update the...
0
9963
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11288
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10657
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9857
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7381
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4904
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3501
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.