Skip to main content
Restate may replay a handler after a suspension or retry. Calls to Python’s standard logger run again during replay and can produce duplicate log entries.

Replay-aware logger

Use restate.getLogger() inside your service code to create a standard Python logger with RestateLoggingFilter already attached:
The filter suppresses records emitted while Restate is replaying the handler. Logs from the first execution attempt and logs emitted outside a Restate invocation are unaffected. Configure handlers, formatters, destinations, and log levels with Python’s standard logging APIs.

Add the replay filter to an existing logger

If your application or framework already creates its loggers, attach RestateLoggingFilter directly:
Add the filter to every logger whose handler logs should be suppressed during replay.