ASP.NET/WCF跟踪在Sharepoint中不起作用
我为我的WCF Web服务配置了如下消息跟踪:ASP.NET/WCF跟踪在Sharepoint中不起作用,wcf,sharepoint,logging,trace,Wcf,Sharepoint,Logging,Trace,我为我的WCF Web服务配置了如下消息跟踪: <!--TRACING --> <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Verbose, ActivityTracing" propagateActivity="true"> <listeners> <
<!--TRACING -->
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing" propagateActivity="true">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="log_messages_verbose.log" />
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
这在我的开发机器上运行良好,它将所有消息和跟踪记录到一个xml文件中。
现在,当在Sharepoint Web应用程序中部署webservice作为(子)Web应用程序时,该服务工作正常,但跟踪文件保持为空
我检查了文件的权限,尝试了绝对文件路径,但仍然不起作用
因为webservice是作为子webapplication部署的,所以它从sharepoint继承了web.config设置。这可能是个问题吗?sharepoint是否以某种方式禁用了正常跟踪
欢迎提供任何建议。您是否有可能将其复制到sharepoint的web.config中 还要检查事件日志中的错误消息 编辑 不确定启用的默认值是什么,可以尝试将其设置为true
<trace enabled="true" />
假设您的web服务已部署到其自己的目录中(这样它就不会干扰SharePoint),您是否尝试将具有上述跟踪配置的web.config添加到该目录中
否则,正如设拉子建议的那样,尝试将跟踪代码添加到SharePoint的web.config。我遇到了同样的问题,然后将该部分移动到C:\inetpub\wwwroot\wss\VirtualDirectories\80中的根web.config log4net不工作时我也遇到了同样的问题,并再次将其移动到父web.config文件中
现在两者都可以工作了。我也有同样的问题。对我有效的方法是在SharePoint web.config上使用“SvcConfigEditor.exe”工具。我可能在没有工具的情况下做错事了。C:\inetpub\wwwroot\wss\VirtualDirectories\。web服务有自己的目录(带有单独应用程序池的web应用程序操作)和自己的web.config我尝试了,没有区别:(不幸的是,事件日志中也没有条目)。