Skip to content

Configuring logs as JSON through Dapr CLI does not work #1524

@alkofahi

Description

@alkofahi

I want to initialize Dapr and set all logs to be in JSON format. I installed Dapr on my k8s cluster using the CLI, my command was dapr init -k --log-as-json. I am using CLI v1.15.1. The argument --log-as-json can be seen in the help documentation for the CLI (see below)

Image

Expected Behavior

  • I expect the Dapr control plane services and my dapr services to have logs as JSON.

Actual Behavior

  • My logs are in text format for both the control plane and my services

Steps to Reproduce the Problem

  • Have a k8s cluster available
  • Install Dapr using the CLI command dapr init -k --log-as-json
  • Install a mock dapr service
  • View the logs for any of the Dapr control plane services (e.g., kubectl logs <pod-name> -n dapr-system)
  • You will see them as text (see below
time="2025-07-30T16:16:48.581730274Z" level=info msg="Scheduler stream connected for [JOB_TARGET_TYPE_JOB JOB_TARGET_TYPE_ACTOR_REMINDER]" app_id=main-service instance=main-service-666d47f549-ppqp2 scope=dapr.runtime.scheduler.cluster type=log ver=1.15.8
time="2025-07-30T16:16:48.592725259Z" level=info msg="Skipping migration, no missing scheduler reminders found" app_id=main-service instance=main-service-666d47f549-ppqp2 scope=dapr.runtime.actors.reminders.migration type=log ver=1.15.8
time="2025-07-30T16:16:48.592759959Z" level=info msg="Found 0 missing scheduler reminders from state store" app_id=main-service instance=main-service-666d47f549-ppqp2 scope=dapr.runtime.actors.reminders.migration type=log ver=1.15.8
time="2025-07-30T16:16:48.592769759Z" level=info msg="Migrated 0 reminders from state store to scheduler successfully" app_id=main-service instance=main-service-666d47f549-ppqp2 scope=dapr.runtime.actors.reminders.migration type=log ver=1.15.8
  • Same thing can be noticed for the dapr services

Release Note

RELEASE NOTE: FIX Log as JSON flag in the CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions