Skip to main content

Service logging

For TypeScript services, the log level is set by the environment variable RESTATE_DEBUG_LOGGING.

  • OFF no per-invocation logging. Only startup, discovery, shutdown, abnormal situations.
  • INVOKE: Log for function invocation, suspension, and completion (success or error)
  • JOURNAL: Log each journaled action
  • JOURNAL_VERBOSE: Like JOURNAL, but add Json-ified message to the log.

The default behavior is (when RESTATE_DEBUG_LOGGING is not set)

  • When NODE_ENV=production, the log setting is OFF
  • Otherwise, the INVOKE setting is used.

Console logging

If you use the default Node console logger, log statements will be printed over and over again during replays. To avoid this, you can use the Restate context logger, which is a wrapper around the console logger that suppresses duplicate log statements during replays:"This will not be printed again during replays");
ctx.console.debug("This will not be printed again during replays");
// Any other console logging method can be used