我有一个自托管的WCF服务和一个使用它的WCF客户端(Web引用)。 当我将用于跟踪的诊断和服务模型配置添加到服务器端时,它工作正常,我看到了所有内容。
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="EventsQueueMaxTester.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<applicationSettings>
<EventsQueueMaxTester.Properties.Settings>
<setting name="EventsQueueMaxTester_clsapievents_CLSAPIEventsPollingService3" serializeAs="String">
<value>http://nim15166.nice.com:8002/CLSAPIEvents3</value>
</setting>
</EventsQueueMaxTester.Properties.Settings>
</applicationSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Information">
<listeners>
<add name="messagelistener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="d:\myMessages.svclog"></add>
</listeners>
</source>
<source name="System.ServiceModel" switchValue="Information,ActivityTracing"
propagateActivity="false">
<listeners>
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener"
initializeData="d:\myMessages.svclog"/>
</listeners>
</source>
</sources>
<trace autoflush ="true" />
<sharedListeners>
<add initializeData="d:\myMessages.svclog" type="System.Diagnostics.XmlWriterTraceListener"
name="xml" />
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true"
logMalformedMessages="true"
maxMessagesToLog="5000"
maxSizeOfMessageToLog="2000">
</messageLogging>
</diagnostics>
</system.serviceModel>
</configuration>