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.
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.