Skip to main content

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 available
  • compact: Compact single line format
  • json: 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 requests
  • restate_admin: The component responsible for holding the metadata information and executing service discovery
  • restate_invoker: The component interacting with deployed service deployments
  • restate_worker::partition::state_machine: The state machine effects
  • restate_partition_store: Restate partition storage layer
  • restate_bifrost: Restate durable log layer
  • hyper: The HTTP library

Most log events generated by Restate will also have the following attached attributes:

  • rpc.service: The related service
  • rpc.method: The related method
  • restate.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 issues
  • info,restate_worker::partition::effects=debug to get insights on the state machine effects
  • info,restate_admin=trace to check service discovery and registration