Tracing in ASP.NET

G

Guest

Can I add my own TextWriterTraceListener listeners in ASP.NET (web service)
application. I have the following in web.config file:

<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<!-- remove comment to enable logging -->
<add name="LogFile"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:\Log\ws.log" />

</listeners>
</trace>
</system.diagnostics>

So I could do Trace.WriteLine(); which would write to a file. That's
something I was able to do in Winforms apps.
But I get access denied to .log file error in this web app, when it tries to
parse web.config file. Even though Impersonation is enabled and I am able to
write to that file not using Trace.
Am I misunderstanding Tracing in ASP, is it only meant for output to the
browser?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top