[Alpha]{class="badge informative"}

setDebug (Server SDK)

This page describes the Server SDK setDebug method. For the Web SDK, see setDebug.

The setDebug method turns debug logging on or off while your server runs. When debugging is on, the SDK writes messages about its configuration, each method call, and its results to the console. See debugEnabled for an example of the output.

See Enable debug logging for the diagnostic workflow and production guidance.

The only option is enabled, a boolean that turns debugging on (true) or off (false).

await alloy.setDebug({ enabled: true });

setDebug affects only the instance or forRequest handle that you call it on:

  • On the top-level instance, it changes logging for calls made directly on that instance, for the life of the process. It doesn’t change logging for forRequest handles.
  • On a forRequest handle, it changes logging for that handle only. This lets you debug a single request without turning on logging for all visitors.

To turn on debugging for every request, set debugEnabled to true when you call configure.

Result object result

The setDebug method returns a promise that resolves with an empty object.

recommendation-more-help
experience-platform-help-collection