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 <openhands@all-hands.dev>
This commit is contained in:
openhands 2025-12-12 21:02:25 +00:00
parent d772dd65a5
commit c59015340a

View File

@ -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}"