473,387 Members | 3,033 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,387 software developers and data experts.

Implementing Tracing throughout an application

Hello,

I have a design question regarding Tracing and Trace
Switches.

I understand that Trace Switches can be configured through
an application's .config file. When a switch is
instantiated, the application automatically checks the
configuration file for a matching named switch. If there's
a match, the configuration parameters are set.

My question is this: In a non-trivial application that
spans several classes and several modules, would you
declare and instantiate a single trace switch that gets
passed throughout the application where needed? Or would
you declare and instantiate unique switches within the
classes they are needed, making use of the common name
that appears in the .config file.

E.g. Application with 3 classes - Controller, Alpha, and
Beta. Tracing is required in Alpha and Beta.

Would you declare the trace switch in Controller and pass
reference to Alpha and Beta?
OR
Would you declare individual switches in both Alpha and
Beta where required?

Sincerely,

Trace User
Jul 21 '05 #1
2 1673
"Trace User" <bl*@bling.com> wrote in message
news:08****************************@phx.gbl...
Hello,

I have a design question regarding Tracing and Trace
Switches.

I understand that Trace Switches can be configured through
an application's .config file. When a switch is
instantiated, the application automatically checks the
configuration file for a matching named switch. If there's
a match, the configuration parameters are set.

My question is this: In a non-trivial application that
spans several classes and several modules, would you
declare and instantiate a single trace switch that gets
passed throughout the application where needed? Or would
you declare and instantiate unique switches within the
classes they are needed, making use of the common name
that appears in the .config file.

E.g. Application with 3 classes - Controller, Alpha, and
Beta. Tracing is required in Alpha and Beta.

Would you declare the trace switch in Controller and pass
reference to Alpha and Beta?
OR
Would you declare individual switches in both Alpha and
Beta where required?


It depends upon the switch. If the switch is class specific, I declare it
in the class (static). If it's not class specific, I declare it once in
each assembly.
Jul 21 '05 #2
I know, this doesn't answer the question below, but as an aside . . .

If you're doing that much tracing, you may want to consider something like
log4net. You can dynamically change the level of tracing that is output by
updating an XML config file, it's fast, stable, and makes tracing really
easy.

We're using it in several projects. It's open source and can be found at
http://log4net.sourceforge.net/

Robert
"Trace User" <bl*@bling.com> wrote in message
news:08****************************@phx.gbl...
Hello,

I have a design question regarding Tracing and Trace
Switches.

I understand that Trace Switches can be configured through
an application's .config file. When a switch is
instantiated, the application automatically checks the
configuration file for a matching named switch. If there's
a match, the configuration parameters are set.

My question is this: In a non-trivial application that
spans several classes and several modules, would you
declare and instantiate a single trace switch that gets
passed throughout the application where needed? Or would
you declare and instantiate unique switches within the
classes they are needed, making use of the common name
that appears in the .config file.

E.g. Application with 3 classes - Controller, Alpha, and
Beta. Tracing is required in Alpha and Beta.

Would you declare the trace switch in Controller and pass
reference to Alpha and Beta?
OR
Would you declare individual switches in both Alpha and
Beta where required?

Sincerely,

Trace User

Jul 21 '05 #3

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

Similar topics

15
by: Agoston Bejo | last post by:
Hi, I'm having trouble with implementing some constraints on the database level. An example: --Table A(AID, BID ref. B.BID, ATXT) --Table B(BID, CID ref. C.CID) --Table C(CID) upon insertion...
5
by: Dabbler | last post by:
When I first start up an ASP.NET application with tracing enabled in web.config the first few pages show trace at bottom of the page but then at some point the pages return to normal with no trace...
2
by: deepukutty | last post by:
Hi all, I know tht we can do tracing in two ways.one in application level and the other is at Page level. I am able to see the details of trace either on the page itself or .../trace.axd page....
2
by: Trace User | last post by:
Hello, I have a design question regarding Tracing and Trace Switches. I understand that Trace Switches can be configured through an application's .config file. When a switch is instantiated,...
0
by: cnys | last post by:
We have an ASP.NET 2.0 (C#) app and we're trying to add tracing into it. The tracing functionality within .NET is great, but when we output this to a file, it's kind of sparse. So, we're looking...
0
by: rehto | last post by:
We have an ASP.NET 2.0 (C#) app and we want to enable tracing (see the code snippets below). The first time a user navigates to the app., the tracing works fine (the ASP.NET tracing appears on...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
6
by: Stephen Torri | last post by:
I am trying to produce a singleton class that I can use throughout my library to write tracing information to a file. My intent was to design such that someone using the library in its debug mode...
1
by: RedLars | last post by:
Hi Does the class System.Diagnostics.Trace use a singelton ? I'm able to do this; System.Diagnostics.Trace.WriteLine("test"); However, these give compiler errors; System.Diagnostics.Trace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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,...

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.