How to send the tracing output to a file in the file system?
I have added the following code to my web.config file:
<system.diagnostics>
<trace autoflush="false" indentsize="4" >
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener"
initiali开发者_JAVA技巧zeData="d:\debugging.txt" />
<remove name="Default"></remove>
</listeners>
</trace>
</system.diagnostics>
And I have written this line for sending trace output:
System.Diagnostics.Trace.Write(sID + " tracing id");
But, I can not see any "debugging.txt" file created on my d: drive and there is no trace output.
Am I missing something ?
You need to trace to a directory that the ASP.NET service has write permission on.
What I like to do is just leave the default listener and run TechNet DebugView, which has the option of saving or logging to a file.
精彩评论