473,511 Members | 9,908 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.Level 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" ?>
<configuration>
<system.diagnostics>
<switches>
<add name="GeneralBooleanSwitch" value="1" />
<add name="GeneralTraceSwitch" value="1" />
<add name="UserSpecificTraceSwitch" value="4" />
</switches>
<trace autoflush="true" indentsize="2">
<listeners>
<add name="MyTraceListener"
type="..."
initializeData="..."/>
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
<appSettings>
<add key="UserSpecificTraceUsers" value="User1,User2" />
....
</appSettings>
</configuration>
Jul 21 '05 #1
0 1267

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...
5
3291
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...
0
1150
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...
2
2547
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 ____________________...
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...
1
3390
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....
4
4489
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...
0
1094
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...
7
2420
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...
0
7251
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
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
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...
0
7517
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
5673
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,...
1
5072
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...
0
4743
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...
0
1581
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 ...

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.