tracing-dlt

Crates.iotracing-dlt
lib.rstracing-dlt
version0.1.0
created_at2025-12-01 14:05:28.285894+00
updated_at2025-12-01 14:05:28.285894+00
descriptionDLT log sink for
homepagehttps://github.com/eclipse-opensovd/dlt-tracing-lib
repository
max_upload_size
id1959803
size33,955
(eclipse-opensovd-bot)

documentation

README

tracing-dlt

Crates.io Documentation License A tracing subscriber/layer for sending structured logs and traces to the COVESA DLT daemon.

Overview

tracing-dlt provides a tracing layer that forwards logs and spans to the COVESA DLT daemon. This allows you to use the standard tracing macros in your Rust application while outputting to DLT.

Features

  • Tracing integration - Use standard tracing::info!, tracing::debug!, etc.
  • Structured logging - Field types are preserved when sent to DLT
  • Span context - Nested spans appear in log messages
  • Dynamic log levels - Responds to DLT daemon log level changes
  • Thread-safe - Safe for concurrent use across async tasks
  • Multiple contexts - Support for different logging contexts per span

Note: The tracing-dlt and dlt-rs crates can be used simultaneously in the same application, as long as application registration is done through tracing-dlt.

Basic Example

use tracing_dlt::{DltLayer, DltId};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Initialize DLT layer
    let dlt_layer = DltLayer::new(
        &DltId::new(b"MBTI")?,
        "My Beautiful Trace Ingestor"
    )?;
    // Set up tracing subscriber
    tracing_subscriber::registry()
        .with(dlt_layer)
        .init();

    // Use standard tracing macros
    tracing::info!("Application started");
    tracing::warn!(temperature = 95.5, "High temperature detected");
    // Will be logged with context ID "SPCL"
    tracing::warn!(dlt_context = "SPCL", "Log message on 'special' context id");
    Ok(())
}

Features

  • trace_load_ctrl - Enable DLT load control support (optional)
  • dlt_layer_internal_logging - Enable debug logging for the layer itself

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Contributing

This project is part of Eclipse OpenSOVD, but can be used independently. See CONTRIBUTING.md for guidelines.

References

Commit count: 0

cargo fmt