Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracing Question 2

Status
Not open for further replies.

1Data

MIS
Sep 30, 2005
66
US
I am trying to use the built in tracing function in .Net. However, I have a question. I know how to Write and Warn exception messages to the trace log. However, I have noticed that by disabling the Trace property on my form it clears the trace log. Is Tracing mainly used at development? Because it would be impractical (resources etc.) to leave it on all the time. I wanted to try to record an exception to the trace log when an end-user causes an exception but not leave the trace function on. Once I could get to it I wanted to view it, but it is not there once I turn it back on.

I am using the Trace.IsEnabled = True and then turning it off (Trace.IsEnabled = False)once I have recorded a message to the trace log. I have confirmed that the Write and Warn are working because when I step through it before I go False the exeption is recorded. If someone has a better way to do this I would appreciate any suggestions.

BTW..I have looked into adding Enterprise Instrumentation, but I can't use it for this project because it's very small and from what I have read that type of Instrumentation is not very pratical for a project this small. Also, the trace.axd, which I have attached to a hyperlink for Admin's is recording trace information...wierd. Nice to look at but not very useful if I can't get trace information.
 
The trace.axd is not recording trace information...
 
You should really only use tracing whilst you are testing and turn it off in your production server. Anything that is going wrong on the production server should be trapped so that you can replicate the error on your development server where you can look at the tracing info.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
So it is more of a tool in development of an app not used daily for troubleshooting?

If this is the case I appreciate it ca8...I will stop messing with it. Because it doesn't help me in what I want to do, once it's rolled out.
 
I can't say if anyone else uses in in production but I don't and I don't believe that is what it was intended for.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Yes, I imagine the size of the page that is sent out could be dramatically increased as well as the extra work that the server has to perform.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
There are two types of tracing in .NET.
System.Web.TraceContext which I believe this thread is referring to and I too believe causes a performance hit. There is also System.Diagnostics.Trace which is on by default (not sure about the performance but believe it is minimal when used correctly) and can be very helpful for monitoring deployed apps.
Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top