I'm developing an ASP.NET WebForm application w开发者_如何转开发ith Visual Studio 2008 SP1 and C#.
I've defined the following listener on Web.Config:
<system.diagnostics>
    <trace>
        <listeners>
            <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="D:\Logs\logWeb.txt" />
        </listeners>
    </trace>
</system.diagnostics>
How can redirect output from OutPut Window to this listener? All sentences like this:
System.Diagnostics.Trace.WriteLine("IntegratedManaged: ResolveCulture");
or
System.Diagnostics.Debug.WriteLine("IntegratedManaged: ResolveCulture");
are shown on output window.
I solved the problem. Now, Web.Config look like this:
<system.diagnostics>
    <trace autoflush="true" indentsize="2">
        <listeners>
            <remove name="Default" />
            <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="D:\Logs\logWeb.txt" />
        </listeners>
    </trace>
</system.diagnostics>
It is necessary to remove Default listener.
A good article for it is here
If you want to listen to the WMI events of asp.net application refer this
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论