init_logging_with_otel

Function init_logging_with_otel 

Source
pub fn init_logging_with_otel<L, S>(
    _config: LoggingConfig,
    _otel_layer: L,
) -> Result<(), Box<dyn Error + Send + Sync>>
where L: Layer<S> + Send + Sync + 'static, S: Subscriber + for<'a> LookupSpan<'a>,
Expand description

Initialize logging with OpenTelemetry tracing layer

This function sets up logging with an additional OpenTelemetry layer for distributed tracing.

§Arguments

  • config - Logging configuration
  • otel_layer - OpenTelemetry tracing layer

§Example

use mockforge_observability::logging::{LoggingConfig, init_logging_with_otel};
use tracing_subscriber::layer::SubscriberExt;

// Initialize OpenTelemetry tracer first
// let tracer = ...;
// let otel_layer = tracing_opentelemetry::layer().with_tracer(tracer);

// Then initialize logging with the layer
// init_logging_with_otel(config, otel_layer).expect("Failed to initialize logging");