Skip to main content
Which UI do you use?
Custom UI
Pre built UI

How to enable debug logs

Enable backend logs#

important

This is only available on versions:

  • supertokens-node >= v9.1.2
  • supertokens-golang >= v0.5.5
  • supertokens-python >= v0.6.3

Our backend SDK provides useful logs that can help with debugging. To enable logging, you need to set the debug setting to true in the init function call:

import supertokens from "supertokens-node";

supertokens.init({
debug: true,
supertokens: {
connectionURI: "...",
},
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: [/*...*/]
});

Logs on your terminal have the following shape:

com.supertokens {"t": "2022-04-09T08:44:49.057Z", "sdkVer": "...", "message": "Started SuperTokens with debug logging (supertokens.init called)", "file": "..."}
  • t: The time the log was generated
  • sdkVer: Version of the SDK you are using
  • message: The log message
  • file: The file and line number from where this log was generated.

Enable frontend logs#

Add enableDebugLogs when calling the init function:

import React from 'react';
import SuperTokens from "supertokens-auth-react";

SuperTokens.init({
enableDebugLogs: true,
appInfo: { /*...*/ },
recipeList: [/*...*/]
});
Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI