Enabling WCF tracing
Who is this article for?
IT Administrators asked to enable WCF tracing.
IT Administrator permissions are required.
The app uses Microsoft's Windows Communication Foundation (WCF) for network communication. Its logging tool is off by default but can be enabled when needed. Tracing can be enabled on the server or client, logging locally.
We may ask you to enable WCF tracing for troubleshooting. This article explains how to do this.
1. Enabling tracing
We will advise you which components (Service, Web Service, Client) need tracing enabled. It should be enabled when users are offline, as changes will disconnect them.
To enable tracing:
- Open App Manager.
- Select the appropriate instance.
- Navigate to the Config tab.
- Access the relevant section (Service, Web Service, or Client).
- Scroll to the bottom of the file.
- Locate the
<!-- WCF Tracing -->section.
- Remove the
<!--and-->comment markers to enable this section.
- Click Save.
If the tracing XML is absent (which is common in legacy systems), copy and paste the provided text into the file.
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true" >
<listeners>
<add name="xml"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="Vision_tracelog.svclog" name="xml" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" traceOutputOptions="Timestamp" />
</sharedListeners>
</system.diagnostics> 2. Configuring tracing
To configure tracing:
- Open App Manager for the instance.
- Navigate to the Config tab.
- Switch to the Client tab.
- Locate the section labelled <!-- Add this for WCF Message logging -->.
- Remove the comment tags
<!--and-->to enable it.
- Click Save.
If this XML section is missing (which is common in legacy systems), copy and paste the provided text above the </system.serviceModel> tag in your file.
<diagnostics>
<messageLogging
logEntireMessage="true"
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true" />
</diagnostics>
3. Distributing updated configuration
If using ClickOnce deployment, the updated client configuration file is downloaded when the application is restarted. Logging will start after the second restart; the first restart downloads the new configuration, and the second applies it.
If ClickOnce is not in use, the file must be distributed manually.
4. Viewing log files
Log files are stored as follows:
- Main service (server) - \inetpub\wwwroot\[Pentana instance]\Service\Vision_tracelog.svclog
- Web Service (server) - \inetpub\wwwroot\[Pentana instance]\WebService\Vision_tracelog.svclog
- Client (PC) - Located in the application folder as Vision_tracelog.svclog
5. Disabling tracing
Tracing should remain enabled only for as long as necessary, as it incurs overhead and consumes disk space. It should be disabled when users are offline, as changes will disconnect them.
To disable tracing:
- Open App Manager.
- Select the appropriate instance.
- Navigate to the Config tab.
- Access the relevant section (Service, Web Service, or Client).
- Scroll to the bottom of the file.
- Locate the
<!-- WCF Tracing -->section. - Comment out the
<system.diagnostics>section using<!--and-->tags.
- Click Save.
- For the Client, also comment out the
<diagnostics>section.
- Click Save.
If using ClickOnce, the updated client configuration file will be downloaded upon the next application start; otherwise, distribute it manually.