Diagnostic Tracing and Message Logging for the Siebel adapter

Adapter clients can enable diagnostic tracing to effectively diagnose problems encountered while using the adapters. Adapter clients can activate tracing at three different levels:

  • Between the adapter client and the adapter

  • Within the adapter

  • Between the adapter and the line-of-business (LOB) application

    This section provides information about activating tracing at these levels.

Tracing between the adapter client and the adapter

Adapter clients can enable WCF tracing to trace issues between the adapter client and the adapter. WCF tracing is used to trace the input XMLs coming from the adapter client using the WCF service model and is useful in diagnosing serialization issues. WCF tracing is not used for the WCF channel model or for output messages from the adapter to the adapter client. You can activate WCF tracing for BizTalk applications and WCF service model applications by adding an excerpt to the respective configuration files. Also, you can enable tracing both at design-time and run-time.

  • Tracing at design-time. For the design-time experience, you may use the Add Adapter Service Reference Plug-in, Consume Adapter Service Add-in, or the Add Adapter Metadata Wizard. All these tools can be used from Visual Studio. So, to enable tracing for the design-time experience, you must add the excerpt to the devenv.exe.config file located in <installation drive>:\Program Files\Microsoft Visual Studio <version>\Common7\IDE.

  • Tracing at run-time. For run-time tracing, you must add the excerpt depending on the application you are using.

    • For a BizTalk Server applications, you must add the excerpt to the BizTalk configuration file, typically BTSNTSvc.exe.config. For BizTalk Server, this file is available typically under <installation drive>:\Program Files\Microsoft BizTalk Server.

    • For a WCF service model .NET application, you must add the excerpt to the app.config file of your project.

    To enable WCF tracing, you must add the following excerpt within the <configuration> tag:

<system.diagnostics>  
    <sources>  
      <source name ="System.ServiceModel" switchValue="Verbose">  
        <listeners>  
          <add name="xml" />  
        </listeners>  
      </source>  
      <source name ="System.ServiceModel.MessageLogging"   
              switchValue="Verbose, ActivityTracing">          
        <listeners>  
          <add name="xml" />  
        </listeners>  
      </source>  
      <source name ="System.Runtime.Serialization" switchValue="Verbose">  
        <listeners>  
          <add name="xml" />  
        </listeners>  
      </source>  
   </sources>  
   <sharedListeners>  
      <add name="xml" type="System.Diagnostics.XmlWriterTraceListener"                
           traceOutputOptions="LogicalOperationStack"   
           initializeData="C:\log\WCFTrace.svclog" />  
   </sharedListeners>  
   <trace autoflush="true" />  
  </system.diagnostics>  
  <system.serviceModel>  
    <diagnostics>  
      <messageLogging   
           logEntireMessage="true"   
           logMalformedMessages="false"  
           logMessagesAtServiceLevel="true"   
           logMessagesAtTransportLevel="false"/>  
    </diagnostics>      
  </system.serviceModel>  

This saves the WCF traces to C:\log\WCFTrace.svclog. WCF tracing provides more info.

Important

Make sure you mitigate potential security threats of exposing sensitive business data by enabling tracing. See Best practices to secure the Siebel adapter

Tracing Within the Adapter

The adapters in the BizTalk Adapter Pack log different categories of useful information to the trace file such as errors, warnings, and information. Such information is useful in understanding the process flow within the adapter and diagnosing issues with the adapter. You can activate WCF LOB Adapter SDK and adapter tracing for BizTalk applications and WCF service model applications by adding an excerpt to the respective configuration files. Also, you can enable tracing both at design-time and run-time.

  • Tracing at design-time. For the design-time experience, you may use the Add Adapter Service Reference Plug-in, Consume Adapter Service Add-in, or the Add Adapter Metadata Wizard. All these tools can be used from Visual Studio. So, to enable tracing for the design-time experience, you must add the excerpt to the devenv.exe.config file located in <installation drive>:\Program Files\Microsoft Visual Studio <version>\Common7\IDE.

  • Tracing at run-time. For run-time tracing, you must add the excerpt depending on the application you are using.

    • For a BizTalk Server applications, you must add the excerpt to the BizTalk configuration file, typically BTSNTSvc.exe.config. For BizTalk Server, this file is available typically under <installation drive>:\Program Files\Microsoft BizTalk Server.

    • For a WCF service model .NET application, you must add the excerpt to the app.config file of your project.

    To enable WCF LOB Adapter SDK and adapter tracing, you must add the following excerpt within the <configuration> tag:

<system.diagnostics>  
    <sources>  
      <source name="Microsoft.ServiceModel.Channels" switchValue="Error">  
        <listeners>  
          <add name="xml" />  
        </listeners>  
      </source>  
      <source name="Microsoft.Adapters.Siebel" switchValue="Information">  
        <listeners>  
          <add name="xml" />  
        </listeners>  
      </source>  
    </sources>  
    <sharedListeners>  
      <add name="xml" type="System.Diagnostics.XmlWriterTraceListener"   
   traceOutputOptions="LogicalOperationStack"   
          initializeData="C:\log\AdapterTrace.svclog" />  
    </sharedListeners>  
    <trace autoflush="true" />  
  </system.diagnostics>  

This would save the WCF traces to C:\log\AdapterTrace.svclog.

Tracing Between the Adapter and the LOB Application

You must enable tracing for communication between the adapter and the LOB application to diagnose issues you suspect within the LOB application. Adapters also depend on LOB tracing (client/server side) to get access to this information. The specifics of turning on LOB tracing are excluded from this document.

Additionally, the Siebel adapter provides a binding property (LogData), which if set to True and if the trace level is set to Verbose, the Siebel adapter logs the information flow between the adapter and the Siebel system. This information is logged along with the adapter traces in the same trace file.

For more information about this binding property, see Read about BizTalk Adapter for Siebel Binding Properties.

Viewing the Traces

You can use the Windows Communication Foundation (WCF) Service Trace Viewer tool to view the traces. For more information about the tool, see Using Service Trace Viewer for Viewing Correlated Traces and Troubleshooting.

Configuring Tracking for BizTalk Applications

The BizTalk Administration Console enables you to configure various tracking options for things such as send ports, receive ports. The tracking configuration settings enable you to track inbound/outbound event data, message properties, message bodies, and orchestrations. For more information about configuring tracking for BizTalk applications, see Managing Artifacts.

You can also use Group Hub to Viewing Tracked Message and Instance Data, including a tracking checklist, and best practices.

See Also

Troubleshoot the Siebel adapter