Logs

    Dapr produces structured logs to stdout either as a plain text or JSON formatted. By default, all Dapr processes (runtime and system services) write to console out in plain text. To enable JSON formatted logs, you need to add the command flag when running Dapr processes.

    If you want to use a search engine such as Elastic Search or Azure Monitor to search the logs, it is recommended to use JSON-formatted logs which the log collector and search engine can parse using the built-in JSON parser.

    Dapr produces logs based on the following schema.

    Plain text and JSON formatted logs

    • Plain text log examples
    • JSON formatted log examples

    Dapr supports both plain text and JSON formatted logs. The default format is plain-text. If you want to use plain text with a search engine, you will not need to change any configuring options.

    Configuring log format in Kubernetes

    The following steps describe how to configure JSON formatted logs for Kubernetes

    You can enable JSON formatted logs for Dapr system services by adding option to Helm command.

    Enable JSON formatted log for Dapr sidecars

    You can enable JSON-formatted logs in Dapr sidecars activated by the Dapr sidecar-injector service by adding the dapr.io/log-as-json: "true" annotation to the deployment.

    API logging enables you to see the API calls from your application to the Dapr sidecar to debug issues. You can combine both Dapr API logging with Dapr log events. See and configure and view Dapr API Logs for more information.

    Log collectors

    If you are using the Azure Kubernetes Service, you can use the default OMS Agent to collect logs with Azure Monitor without needing to install Fluentd.

    If you use Fluentd, we recommend to using Elastic Search and Kibana. This shows how to set up Elastic Search and Kibana in your Kubernetes cluster.

    If you are using the Azure Kubernetes Service, you can use Azure monitor for containers without indstalling any additional monitoring tools. Also read

    References