I want to go live with my application in production and I want to enable logging only certain calls to reduce overhead. How can I do that with the .NET SDK?
Summary
If you do not want to log all the requests and responses, then you can use the SoapRequest and SoapResponse properties of the API call object to get the call request and response and log it to a file.
Detailed Description
Here is a C# sample that logs the request and response for GeteBayOfficialTime:
usingSystem; using System.IO; using eBay.Service.Call; using eBay.Service.Util; using eBay.Service.Core.Sdk; using eBay.Service.Core.Soap;
private void GeteBayOfficialTime() {
ApiContext context = new ApiContext(); context.ApiCredential.eBayToken = "Your Token";
//Server URL for Sandbox context.SoapApiServerUrl = "https://api.sandbox.ebay.com/wsapi"; //For production, the url is https://api.ebay.com/wsapi"