How to enable the WCF Diagnostics Tracing Feature
Section titled “How to enable the WCF Diagnostics Tracing Feature”Learn how to enable WCF Diagnostics to enable Logging with Nodinite. To enable WCF Diagnostics logging, follow the steps below.
First, make sure you comply with the prerequisites.
Enable Logging
Section titled “Enable Logging”Repeat the steps as required to enable logging for multiple WCF applications.
Step 1: Copy files from ZIP
Section titled “ Step 1: Copy files from ZIP”If you already performed this step during the installation, then go to the next step. Otherwise, copy the files from the ZIP package, and make sure Windows does not block them.
Step 2: Edit configuration section
Section titled “ Step 2: Edit configuration section”Open your web/app.config and add/modify the <system.diagnostics> section as detailed below:
Required Properties
Section titled “Required Properties”- PickupFolder - Folder where to write the WCF Diagnostics output files, for example
C:\Temp\Nodinite.LogAgent.WCFDiagnostics42. - LogAgentId - The unique LogAgentId, see Log Agents for additional details, for example
42.
Critical for Business Intelligence
Section titled “Critical for Business Intelligence”- DefaultMessageType - Default Message Type for all WCF messages. Set to a meaningful business transaction name (e.g.,
"OrderService#1.0","CustomerAPI#2.0"). This enables Search Field Expressions to extract business data. If MessageTypeFromBody = true, this is used as fallback when extraction fails. Default:"IM.LogAgent.WCFDiagnostics/1.0#DefaultMessageType"(not recommended - use a business-meaningful name instead) - MessageTypeFromBody - When
true, automatically extracts Message Type from WCF message body using XPath/MessageLogTraceRecord/Envelope/Body(namespace#node). Useful when WCF applications handle multiple message types. Falls back to DefaultMessageType if extraction fails. Default:false
<system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing"> <listeners> <add name="Nodinite.LogAgent.WCFDiagnostics" /> </listeners> </source> <source name="System.ServiceModel.MessageLogging" switchValue="Information, ActivityTracing"> <listeners> <add name="Nodinite.LogAgent.WCFDiagnostics" /> </listeners> </source> </sources> <sharedListeners> <add type="Nodinite.LogAgent.WCFDiagnostics.EventJsonWriterTraceListener, Nodinite.LogAgent.WCFDiagnostics" name="Nodinite.LogAgent.WCFDiagnostics" traceOutputOptions="None" PickupFolder="C:\Temp\Nodinite.LogAgent.WCFDiagnostics42" LogAgentId="42" DefaultMessageType="" MessageTypeFromBody="true" DefaultEndPointName="" DefaultEndPointUri="" IncomingEventTimeout="10"> <filter type="" /> </add> </sharedListeners> <trace autoflush="true" /></system.diagnostics>* name - should not be changed. If you do change it you need to replace all occurrences:
Step 3: Edit system.serviceModel section
Section titled “ Step 3: Edit system.serviceModel section”Open your web/app.config and add/modify <system.serviceModel> section.
<diagnostics> <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="100000000" maxSizeOfMessageToLog="536870912" /></diagnostics>Step 4: Configure Newtonsoft version
Section titled “ Step 4: Configure Newtonsoft version”Make sure to set the correct version of the Newtonsoft dll in the attribute newVersion, 9.0.0.0 is default with the downloaded version.
Open your web/app.config and add/modify <configuration> section.
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="9.0.0.0" /> </dependentAssembly> </assemblyBinding></runtime>Step 5: Save
Section titled “ Step 5: Save”Step 6: Configure Pickup Service
Section titled “ Step 6: Configure Pickup Service”Now install and configure the Nodinite Pickup Log Events Service Logging Agent to fetch log files from the PickupFolder and log to the Nodinite Log API:
Step 7: Configure Log Views
Section titled “ Step 7: Configure Log Views”Now Add or manage Log Views and use the Log Views to view the WCF Diagnostic output.
Step 8: Configure Message Types
Section titled “ Step 8: Configure Message Types”Define Message Types in Nodinite Administration that correspond to your DefaultMessageType configuration:
- Navigate to Administration > Log Management > Message Types
- Create a new Message Type matching your DefaultMessageType (e.g., "OrderService#1.0")
- Set the Message Type name to match the namespace and root element of your WCF messages
- Provide a meaningful description for business users
Step 9: Configure Search Field Expressions
Section titled “ Step 9: Configure Search Field Expressions”Configure Search Field Expressions to extract business-critical data from your WCF messages:
- Navigate to Administration > Log Management > Search Fields
- Create Search Field Expressions for your Message Type using:
- XPath - For XML WCF messages (e.g.,
/Order/OrderId,/Customer/CustomerNumber) - JSON Path - For JSON WCF messages (e.g.,
$.order.orderId,$.customer.customerNumber) - RegEx - For text-based WCF messages or complex patterns
- XPath - For XML WCF messages (e.g.,
- Test expressions against sample WCF messages
- Assign expressions to appropriate Message Types
This enables business users to search WCF logs by Order IDs, Customer Numbers, Invoice Numbers, and other business-critical data.
Step 10: Configure Non-Events Monitoring (Optional)
Section titled “ Step 10: Configure Non-Events Monitoring (Optional)”Set up Non-Events Monitoring to detect missing WCF transactions or data outages:
- Navigate to Administration > Log Management > Non-Events Monitoring
- Create monitoring rules for your WCF Message Types
- Define expected message volumes and time windows
- Configure alerts using Alarm Plugins
This proactively alerts you when WCF messages are missing or volumes drop unexpectedly.
Step 11: Design BPM Processes (Optional)
Section titled “ Step 11: Design BPM Processes (Optional)”Use Business Process Modeling (BPM) to correlate WCF transactions end-to-end across your applications and systems:
- Navigate to Administration > BPM
- Design business process flows that include your WCF services
- Define correlation rules using Search Fields (Order IDs, Transaction IDs, etc.)
- Map WCF Message Types to process steps
- Enable end-to-end transaction tracking
This provides complete visibility into business transactions flowing through your WCF applications and other systems.
Next Steps
Section titled “ Next Steps”Complete these steps to unlock business intelligence for your WCF applications:
- Message Types – Define business transaction types in Nodinite Administration (Critical first step)
- Search Field Expressions – Configure extraction of business data from WCF messages
- Log Views – Create views for self-service access to WCF diagnostic data
- Non-Events Monitoring (Optional) – Set up alerts for missing WCF transactions
- Business Process Modeling (BPM) (Optional) – Design end-to-end transaction flows
Related Topics
Section titled “ Related Topics”- Message Types (Mandatory) - Define business transaction types for Search Field extraction
- Search Field Expressions - Extract business data from WCF messages using XPath, JSON Path, or RegEx
- Log Views - Manage user access to WCF diagnostic data with role-based security
- Non-Events Monitoring - Track message volumes and detect data outages in WCF applications
- Business Process Modeling (BPM) - Correlate transactions end-to-end across systems
- Alarm Plugins - Configure alerts for Non-Events and other monitoring scenarios
- Pickup Log Events Service Logging Agent - Fetches WCF trace files asynchronously
- Log Agents - Manage Log Agents
- Log - Log Management overview