Dash0 Logo
Infrastructure MonitoringLog ManagementApplication Performance ManagementDistributed TracingKubernetes MonitoringDashboardsAlertingService MapIntegrationsTransparent CostObservability as Code
PricingDocs
GuidesBlogKnowledgePodcastIntegrationsChangelog
Contact usMeet our TeamCareersSecurity
  • Book A Demo
  • Sign In
  • Start Free Trial
Book a demoSign in
Start Free Trial

    Resources

      PricingBlogKnowledgeIntegrationsDocumentationGlossaryOTelBin.ioSitemap

    Company

      Our TeamCareersSecurity

    Contact

      Contact usGitHubLinkedInXYouTubeDash0 Newsletter
Subscribe to our newsletter

Receive updates on OTelBin, Dash0, Observability, OpenTelemetry, and more.

  • Terms and Conditions
  • Privacy Policy
  • Data Processing Agreement
  • Vulnerability Disclosure

©2025 Dash0 Inc.

Hub/Logback

Technology

Logback

Dash0 Java Logback integration provides efficient log collection with minimal overhead using OpenTelemetry Logback Appender.

Overview

Overview

Logback is one of the most widely used logging frameworks for Java applications. It was designed as a successor to the popular Log4j project and natively implements the SLF4J API, making it both powerful and flexible for various logging needs.

Use Cases

  • Send your Logback logs to Dash0 for unified observability with your metrics and traces
  • Correlate logs with traces to gain valuable context about your application behavior
  • Leverage structured logging with MDC (Mapped Diagnostic Context) attributes for better filtering and analysis
  • Monitor application errors and exceptions with full stack traces in a centralized location

Setup

Configuring Logback with OpenTelemetry

Logback can be configured to export logs directly through the OpenTelemetry protocol using the OpenTelemetry Logback Appender. This approach ensures your logs are properly correlated with traces and metrics in Dash0.

Add the OpenTelemetry Logback Appender dependency

First, add the OpenTelemetry Logback Appender dependency to your project.

Maven:

Gradle:

Configure the Logback appender

Next, update your logback.xml configuration file to include the OpenTelemetry appender:

Configuration options

The OpenTelemetry appender supports several configuration options:

  • captureExperimentalAttributes: Captures experimental attributes like thread.name.
  • captureCodeAttributes: Captures code location attributes (file, line number)
  • captureMarkerAttribute: Captures SLF4J marker attributes
  • captureKeyValuePairAttributes: Captures key-value pairs from structured logging
  • captureLoggerContext: Captures the logger context
  • captureMdcAttributes: Captures MDC (Mapped Diagnostic Context) attributes using the specified pattern

Initialize the OpenTelemetry Appender

Finally, make the appender aware of your OpenTelemetry SDK instance as early as possible in your application's startup sequence:

Using with Mapped Diagnostic Context (MDC)

Logback's MDC provides a way to enrich log events with additional contextual information. The OpenTelemetry appender can capture these MDC values as attributes on your log records:

With this configuration, your logs will be sent to Dash0 via OpenTelemetry, properly correlated with your traces and metrics, providing you with a unified view of your application's behavior.

Related Integrations

Java