The LogHelper function helps you with the tracing or logging. The ILogHelper instance is returned when GetLogHelper() is called provides you with the following methods.

Methods Available in LogHelper

void LogCritical(string message, Exception ex);
void LogDebug(string message);
void LogDebug(object obj);
void LogError(string message, Exception ex);
void LogInformation(string message);
void LogTrace(string message);
void LogWarning(string message);
CODE

Example

var logHelper = GetLogHelper();
logHelper.LogTrace("Trace Statement");
logHelper.LogDebug("Debug Statement");
logHelper.LogWarning("Warning Statement");
logHelper.LogInformation("Info Statement");
AccountQueryModel account = new AccountQueryModel(){
  Id= "0013i0000043m9eAAA", 
  Name =  "Account_B5F83C"
};
logHelper.LogDebug(account);
logHelper.LogError("Error Message", new Exception("SystemException"));

public class AccountQueryModel
{
  public string Id {get; set;}
  public string Name {get; set;}
  public string Type {get; set;}
}
CODE

Console Output

Trace Statement
Debug Statement
Warning Statement
Info Statement
{"Id":"0013i0000043m9eAAA","Name":"Account_B5F83C","Type":null}
Error Message
{
  "ClassName": "System.Exception",
  "Message": "SystemException",
  "Data": null,
  "InnerException": null,
  "HelpURL": null,
  "StackTraceString": null,
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": null,
  "HResult": -2146233088,
  "Source": null,
  "WatsonBuckets": null
}
CODE

When debugging or troubleshooting callback related issues, follow the minimal logging approach and add log statements in the callback code and then remove log statements from the code once it is done.