Type to search.

Enable debug logging

Serverless Observability

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Elastic Agent

Elastic Agent can run in OpenTelemetry mode to retrieve traces, metrics, and logs from your infrastructure and applications, and forward them to Elastic Observability.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

You can enable debug-level logging in the Elastic Agent by either modifying the configuration file or passing a runtime override. This is useful when troubleshooting startup issues or configuration problems.

This guide shows how to enable debug logging in different environments.

If you're running the Elastic Agent directly, you can choose between two approaches:

Both approaches increase log verbosity and help surface misconfigurations.

Add the following section to your Elastic Agent configuration file (typically otel.yml):

YAML
service:
  telemetry:
    logs:
      level: debug

This method works across all deployment environments.

Pass the log level as a runtime argument using the --set flag:

Shell
otelcol --set=service.telemetry.logs.level=debug

This applies debug-level logging without modifying your configuration file.

If you're deploying the Elastic Agent using the OpenTelemetry Helm charts, enable debug logging by adding the configuration directly in your values.yaml file:

YAML
config:
  service:
    telemetry:
      logs:
        level: debug

Alternatively, use a CLI override when installing or upgrading the OpenTelemetry Collector Helm Chart release:

Shell
helm upgrade my-opentelemetry-collector open-telemetry/opentelemetry-collector --set mode=daemonset --set image.repository="docker.elastic.co/elastic-agent/elastic-otel-collector" --set image.tag="9.5.6" --set config.service.telemetry.logs.level=debug

This ensures the Collector logs at debug level when deployed into your cluster.

Standalone and Kubernetes are currently the only officially supported deployment environments for the Elastic Agent.

However, if you're running the Collector in a different context, such as a manually containerized setup, you can still enable debug logging using the same methods:

  • Add it to your configuration file using the service.telemetry.logs.level setting

  • Pass it at runtime with --set=service.telemetry.logs.level=debug

Note

Debug logging for the Collector is not currently configurable through Fleet.

To learn how to enable debug logging for the EDOT SDKs, refer to Enable debug logging for EDOT SDKs.