跟踪 .NET 1.1 Web 服务调用
我在尝试使用 .NET 1.1 查找 Web 服务的错误时遇到问题。在 .NET 2.0/3 中,我可以将跟踪部分添加到我的 Web 配置中,如下所示:
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Web.Services.Asmx">
<listeners>
<add name="AsmxTraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\subconnector\local.log" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId" />
</listeners>
</source>
</sources>
<switches>
<add name="System.Web.Services.Asmx" value="Verbose" />
</switches>
</system.diagnostics>
这非常有效,我可以获得有关访问服务的内容的详细日志。但是当我尝试在 .NET 1.1 站点中使用它时,它给出了一个错误 - 它无法识别标签。因此,使用谷歌搜索时可以找到的内容,我将其修剪为:(
<system.diagnostics>
<switches>
<add name="General" value="4" />
<add name="Data" value="1" />
<add name="System.Web.Services.Asmx" value="4" />
</switches>
<trace autoflush="true" indentsize="4" >
<listeners>
<add name="TextListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="d:\logfiles\local.log" />
</listeners>
</trace>
</system.diagnostics>
我添加了“常规”和“数据”行..因为我在 MSDN 页面中看到了开关...)
但是没有任何内容写入我的日志档案。文件已创建,但没有输出。有人对如何进行追踪有任何见解吗?
(我的问题是,我们的 Web 服务的使用者遇到“网络错误” - 当他们尝试访问该服务时,我们可以看到 IIS 日志条目,但没有其他迹象表明它超过了初始 IIS 命中 - 没有其他日志我们可以使用发现页面(点击 .asmx 页面)访问 Web 服务,并且工作正常。)
谢谢。
I'm having an issue trying to find an error with a web service using .NET 1.1. In .NET 2.0/3 I can add a trace section to my web config like:
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Web.Services.Asmx">
<listeners>
<add name="AsmxTraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\subconnector\local.log" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId" />
</listeners>
</source>
</sources>
<switches>
<add name="System.Web.Services.Asmx" value="Verbose" />
</switches>
</system.diagnostics>
And that works great, I get detailed logs of what is hitting the service. But when I tried to use that in a .NET 1.1 site, it gave an error - it does not recognize the tags. So using what I could find while googling, I trimmed it down to:
<system.diagnostics>
<switches>
<add name="General" value="4" />
<add name="Data" value="1" />
<add name="System.Web.Services.Asmx" value="4" />
</switches>
<trace autoflush="true" indentsize="4" >
<listeners>
<add name="TextListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="d:\logfiles\local.log" />
</listeners>
</trace>
</system.diagnostics>
(I added the "General" and "Data" lines .. because I saw that in the MSDN page for the switches...)
But nothing is written to my log file. The file gets created, but no output. Anyone have any insight on how to get tracing?
(My problem is, a consumer of our web service is getting a "network error" - We can see a IIS log entry when they try to access the service, but there's no other indication it gets past the initial IIS hit - no other logs are written. We can hit the web service using the discovery page (hitting the .asmx page), and it works fine.)
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论