×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

[Q]TextWriterTraceListener does not work under asp.net 2.0

C# code:

Trace.Writeline("hello") does not complain but does not create C:\xxx.log file.
The same code was working on asp.net 1.1 and is working on regular application on
framework 2.0. But it does not work on asp.net and webservice/framework 2.0.

I guess it may associate with security since asp application is using different context
from that of regular window/console application.

Any advice is appreciated.


_______________web.config____________________

<system.web>
<trace enabled="true" pageOutput="true" localOnly="true" writeToDiagnosticsTrace ="true"/>
</system.web>

<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="xxxxx" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\xxx.log" />
<remove name="Default"/>
</listeners>
</trace>
</system.diagnostics>
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / [Q]TextWriterTraceListener does not work under asp.net 2.0
    C# code:

    Trace.Writeline("hello") does not complain but does not create C:\xxx.log file.
    The same code was working on asp.net 1.1 and is working on regular application on
    framework 2.0. But it does not work on asp.net and webservice/framework 2.0.

    I guess it may associate with security since asp application is using different context
    from that of regular window/console application.

    Any advice is appreciated.


    _______________web.config____________________

    <system.web>
    <trace enabled="true" pageOutput="true" localOnly="true" writeToDiagnosticsTrace ="true"/>
    </system.web>

    <system.diagnostics>
    <trace autoflush="true" indentsize="4">
    <listeners>
    <add name="xxxxx" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\xxx.log" />
    <remove name="Default"/>
    </listeners>
    </trace>
    </system.diagnostics>
    • up