Log Levels
You can control the verbosity of logs using environment variables:-
Set the log level:
Use theRESTATE_LOGGING
environment variable.
Possible values:TRACE
,DEBUG
,INFO
,WARN
,ERROR
. -
Default log level:
INFO
ifNODE_ENV=production
DEBUG
otherwise
-
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.console
for all logging inside handlers to ensure clean, non-redundant logs.