IBM Support

How can I turn on logging for API / Excel Add-In errors and messages?

Question & Answer


Question

How can I turn on logging for API / Excel Add-In errors and messages?

Answer

WCF (Windows Communication Foundation) Message logging (Debug) is an option that can be turned on to log API call errors. The initializeData value is the location where the log file is saved to. This file can grow rapidly, which is why we recommend to only turn on the logging for limited durations.

Since Excel Add-In uses API, this is a good approach to see if an error occurs when Excel Add-In crashes or experiences errors.

To enable the debug, add the following tags in the <sources> tag (see changes in red):

?<sources>
? <source name="System.ServiceModel" switchValue="Information ActivityTracing" propagateActivity="true">
?? <listeners>
??? <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "c:\temp\traces.svclog" />
?? </listeners>
? </source>

?</sources>

If you find that your log file becomes too large you can split the file into multiple parts by enabling multi-file logging:

<system.diagnostics>
??? <trace autoflush="true"/>
??? <sources>
????? <source name="System.ServiceModel" switchValue="InformationActivityTracing" propagateActivity="true">
??????? <listeners>
????????? <add name="CircularTraceListener" />
??????? </listeners>
????? </source>

??? </sources>
??? <sharedListeners>
????? <add name="CircularTraceListener" type="Microsoft.Samples.ServiceModel.CircularTraceListenerCircularTraceListener"
?????????? initializeData="c:\logs\CircularTracing-service.svclog" maxFileSizeKB="100" />
??? </sharedListeners>

? </system.diagnostics>

Note: WCF Message Logging requires Windows SDK (http://www.microsoft.com/en-us/download/details.aspx?id=8279). Please make sure that Windows SDK is installed."

[{"Business Unit":{"code":"BU051","label":"N\/A"},"Product":{"code":"SUPPORT","label":"IBM Worldwide Support"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB33","label":"N\/A"}}]

Document Information

More support for:
IBM Worldwide Support

Software version:
All Versions

Document number:
781539

Modified date:
02 November 2020

UID

ibm10781539