473,322 Members | 1,347 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,322 software developers and data experts.

How to implement Trace best

Hallo,
The best thing would be to implement a trace call in every procedure to
write an entry in the log file:
If MySwitch.TraceVerbose() then trace.writeline("Procedure xyz started with
Parameters ...")

Unfortuantelly is this a lot of work.
Is there an easier way to implement a good tracing?
How is tracing done in professional applications?
Thanks, Thorsten

Nov 22 '05 #1
2 1344
I don't know about performance overhead issues here, but you could be more
generic by using code like:

Trace.WriteLine("Entering " + MethodBase.GetCurrentMethod().ToString () );

and there are probably Reflection methods you could call to enumerate the
parameter names and values.
--
Phil Wilson [MVP Windows Installer]
----
"Thorsten Tarrach" <th********@gmx.de> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
Hallo,
The best thing would be to implement a trace call in every procedure to
write an entry in the log file:
If MySwitch.TraceVerbose() then trace.writeline("Procedure xyz started with
Parameters ...")

Unfortuantelly is this a lot of work.
Is there an easier way to implement a good tracing?
How is tracing done in professional applications?
Thanks, Thorsten

Nov 22 '05 #2

"Phil Wilson" <ph*********@unisys.spamcom> schrieb im Newsbeitrag
news:OO*************@TK2MSFTNGP11.phx.gbl...
I don't know about performance overhead issues here, but you could be more
generic by using code like:

Trace.WriteLine("Entering " + MethodBase.GetCurrentMethod().ToString () );
and there are probably Reflection methods you could call to enumerate the
parameter names and values.


Yes, that is a good idea, I can get all methods with the StackTrace.
Unfortunatelly is there no way to get the paramterters passed to that
method.

Next would be error tracing. Can be done the same way, but is there some
kind of event fired, when an error occurs?
Thorsten

Nov 22 '05 #3

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

Similar topics

2
by: Thorsten Tarrach | last post by:
Hallo, The best thing would be to implement a trace call in every procedure to write an entry in the log file: If MySwitch.TraceVerbose() then trace.writeline("Procedure xyz started with...
3
by: Jens Alenius | last post by:
I've been looking at the Trace and TraceSwitch Classes i C# and I thrying to make it act more like java log4j. What I want is to add two different tracelisteners (like EventLogTraceListener and...
5
by: martin | last post by:
Hi, The trace class seems to me to be very usefull however there are a few features of it that have to confused. I am using visual studio 2003. the IDE will not let me write ...
7
by: Brian Henry | last post by:
Hi, I am doing the following stored procedure CREATE PROCEDURE . @sender varchar(50), @subject varchar(400), @messagebody text, @hasAttachments bit, @sentTime DateTime AS
13
by: TJS | last post by:
How can I use trace.warn in a code class. I set the calling aspx page with trace=true but get this error when I put a trace.warn("hello") in my code class ------------------...
1
by: Mukund Patel | last post by:
Hi Friends, I am working on asp.net in .net studio 2005 (Whidbey). I want to write trace in file in my web application. How to implement Diagnostics Trace features in Whidbey. I have written...
7
by: Don | last post by:
Can anyone give me an example of implementing ICloneable to give a class I created a "Clone" method so I can make copies of objects. I have no idea where to begin with this. Thanks. - Don
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
7
by: Frank | last post by:
I'm running into trouble and I hope someone can help. I have two assemblies. The first defines a base class and a series of distinct classes based on the base class. Something similar too: ...
2
by: Rick Mavrovik | last post by:
hi one of the pages in my asp.net application is taking very long to load. i want find out what is causing the problem. its probably ajax. i am not finding the asp.net trace any useful, i mean i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.