Troubleshooting Xbox Live Services APIs

It is difficult to diagnose a failure using only the error from the Xbox Live Services API layer. Additional, helpful error information — such as logging of all RESTful calls — can be made available to the server.

To listen to this additional data, hook up the response logger and enable debug tracing. Response logging allows you to see HTTP traffic and web service response codes, which is often as useful as a Fiddler trace.

Code example

The following code example enables response logging, and sets the debug error level to Verbose. (You can also set the debug error level to Error, to show only trace failed calls; or to Off, to disable tracing.)

The resulting debug output is sent to the Output pane when running your project in Visual Studio.

C API

HCSettingsSetTraceLevel(HCTraceLevel::Verbose); // See HCTraceLevel enum for various levels
HCTraceSetTraceToDebugger(true);
void CALLBACK TraceCallback(
    _In_z_ char const* areaName,
    enum HCTraceLevel level,
    uint64_t threadId,
    uint64_t timestamp,
    _In_z_ char const* message
)
{
    // Log info
}

HCTraceSetClientCallback(TraceCallback);