我有网络托管的客户端端点与桌面应用服务端点通信。这是客户端端点上的配置:
<system.serviceModel>
<client>
<endpoint address="net.tcp://10.8.20.175:3337/NotificationService"
binding="netTcpBinding" contract="INotificationService"
name="NetTcpBinding_INotificationService" />
</client>
<bindings>
<netTcpBinding>
<binding sendTimeout="00:10:00" maxReceivedMessageSize="1000000" name="NetTcpBinding_INotificationService"/>
</netTcpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
这是服务端点端的配置:
<services>
<service behaviorConfiguration="NotificationServiceBehavior"
name="NotificationService">
<endpoint address="" binding="netTcpBinding" contract="INotificationService" />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:3337/NotificationService" />
</baseAddresses>
</host>
</service>
</services>
我尝试通过添加以下
来启用服务端WCF跟踪<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="sdt"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "C:\data\logs\trace.log" />
</listeners>
</source>
</sources>
但是,我没有生成trace.log。
那么如何在桌面应用程序端获取跟踪日志?谢谢!
答案 0 :(得分:0)
我没有看到这个:
<diagnostics wmiProviderEnabled="false">
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
在system.ServiceModel。
下