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