From c59015340a9e66d484f0c6dd4adfd9152cb7fb31 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 12 Dec 2025 21:02:25 +0000 Subject: [PATCH] Enable JSON logging for enterprise cloud deployments This change enables JSON logging in the enterprise Dockerfile by setting LOG_JSON=1 environment variable. This ensures that all logs, including third-party libraries like LiteLLM, are properly formatted as JSON for cloud logging systems (e.g., Google Cloud Logging, Datadog). Without this setting, some logs were being emitted in plain text format: > LiteLLM completion() model= prod/claude-sonnet-4-5-20250929; provider = litellm_proxy With this change, all logs will be properly structured as JSON for better parsing, filtering, and analysis in cloud environments. Co-authored-by: openhands --- enterprise/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/enterprise/Dockerfile b/enterprise/Dockerfile index b0ca56a7f6..f5b3d12433 100644 --- a/enterprise/Dockerfile +++ b/enterprise/Dockerfile @@ -2,6 +2,9 @@ ARG OPENHANDS_VERSION=latest ARG BASE="ghcr.io/openhands/openhands" FROM ${BASE}:${OPENHANDS_VERSION} +# Enable JSON logging for cloud deployments +ENV LOG_JSON=1 + # Datadog labels LABEL com.datadoghq.tags.service="deploy" LABEL com.datadoghq.tags.env="${DD_ENV}"