Find the answer to your question
I can't turn on SDK logging because the log files are too large and unmanageable.
Is there a way to have the .NET SDK do payload logging (request and response) only on certain errors or exceptions?
Exception based logging is not yet available for the .NET SDK.
However, this feature is scheduled to become available with the 485 Full Release.
The 485 Full Release is scheduled for release in early December 2006.
Exception based logging provides the ability to perform full request and response logging on a conditional basis.
The current implementation for logging does log the fact that an exception occurred.
However, the request and response logging is "all of the time or none of the time".
This is a major roadblock, especially for high volume applications, when trying to use logging for finding, triaging, and resolving problems quickly.
Simply put, "all of the time" logging can generate very large log files which creates a whole new set of problems.
With the 485 Full Release, the .NET SDK will provide a way to perform conditional full request and response logging using the same interfaces used by the CallRetry mechanism.
Here is a preview of the design and the interfaces that will be available in the 485 Full Release:
1. The error selection in CallRetry will be broken out to a reusable class, ExceptionFilter.
This ExceptionFilter class will have 3 properties: TriggerExceptions, TriggerErrorCodes, TriggerHttpStatusCodes.
These are the same as the existing CallRetry properties.
The exception condition matching rules and algorithm are the same as for CallRetry.
2. ApiLogManager will take an MessageLoggingFilter property with is an ExceptionFilter.
If message logging is enabled (through the existing EnableLogging property), and if the MessageLoggingFilter is null, all messages will be logged.
If MessageLoggingFilter is not null, then request and response logging will be done only for the conditions matching the filter.
3. The configuration file for the SoapApiDemo sample will support lists of exceptions, error codes, and HTTP status codes for this purpose, so that the feature can be used and tested easily.