4
我有这样的自定义处理程序,为什么不跟踪监听器日志自定义处理器流量?
public class Handler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
}
为什么这个不行?
<system.diagnostics>
<sources>
<source name="System.Web" switchValue="All" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\logs\Traces_Documents.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
当它在web.config中时,它在我调用处理函数时什么也不做。没有日志记录等
我以前在System.ServiceModel命名空间和WCF服务上使用过相同的跟踪监听器,并且工作正常。