Logging
By default, Restate logs INFO, WARN and ERROR events using a pretty format.
A complete list of configuration options is available in the configuration documentation.
For service logging, check the Typescript SDK logging and Java SDK logging pages.
Log filter
You can modify the filter used for log events setting the configuration entry log-filter
, or alternatively setting the RUST_LOG
environment variable. Check the RUST_LOG
documentation for more details about the filter format. For example to enable debug logs on all Restate components, and info on other logs, set the filter as info,restate=debug
. See the paragraph below components and log events for more details about filter targets.
Log format
You can modify the log format by setting the configuration entry log-format
(or via restate-server --log-format=<FORMAT>
) as follows:
pretty
: Very verbose pretty format with rendered error descriptions, when availablecompact
: Compact single line formatjson
: Newline delimited json format
Components and log event context fields
The following components are producing relevant logs:
restate_ingress_http
: The Restate component ingesting HTTP requestsrestate_admin
: The component responsible for holding the metadata information and executing service discoveryrestate_invoker
: The component interacting with deployed service deploymentsrestate_worker::partition::state_machine
: The state machine effectsrestate_partition_store
: Restate partition storage layerrestate_bifrost
: Restate durable log layerhyper
: The HTTP library
Most log events generated by Restate will also have the following attached attributes:
rpc.service
: The related servicerpc.method
: The related methodrestate.invocation.id
: The invocation identifier
Recommendations
When testing Restate locally, we recommend keeping the default configuration.
When deploying in production, we recommend setting the log level to info
and enabling the json
format in conjunction with a log collector, so you can later inspect and filter logs based on its event fields.
We recommend to set up logging to a more verbose filter, and use the pretty
format. Some example filters:
info,restate_ingress_http=trace,restate_invoker=trace,restate=debug,hyper=debug
for network related issuesinfo,restate_worker::partition::effects=debug
to get insights on the state machine effectsinfo,restate_admin=trace
to check service discovery and registration