Log Levels
You can control the verbosity of logs using environment variables:-
Set the log level:
Use theRESTATE_LOGGINGenvironment variable.
Possible values:TRACE,DEBUG,INFO,WARN,ERROR. -
Default log level:
INFOifNODE_ENV=productionDEBUGotherwise
-
Verbose journal logging:
If you setRESTATE_LOGGING=TRACE, you can enable even more detailed journal logs with:
RESTATE_JOURNAL_LOGGING=TRACE
Console Logging
By default, using the Node.js console logger will print log statements repeatedly during replays.To avoid duplicate logs during replays, use the Restate context logger. The context logger wraps the console and suppresses duplicate log statements during replays:
- The context logger uses the same log level filtering as described above.
- Use
ctx.consolefor all logging inside handlers to ensure clean, non-redundant logs.