Skip to main content

Module logging

Module logging 

Source
Expand description

Structured logging with trace correlation.

This module provides enterprise-grade logging infrastructure with:

  • Automatic trace ID and span ID injection
  • JSON structured output for log aggregation
  • Log level filtering by module
  • Integration with the tracing crate

§Example

use ringkernel_core::logging::{LogConfig, StructuredLogger, LogOutput};

let config = LogConfig::builder()
    .level(LogLevel::Info)
    .output(LogOutput::Json)
    .with_trace_correlation(true)
    .build();

let logger = StructuredLogger::new(config);
logger.info("Kernel started", &[("kernel_id", "k1"), ("mode", "persistent")]);

Structs§

ConsoleSink
Console log sink.
FileLogSink
File log sink.
LogConfig
Configuration for structured logging.
LogConfigBuilder
Builder for log configuration.
LogEntry
A structured log entry.
LogSinkError
Log sink error.
LoggerStats
Logger statistics.
MemoryLogSink
Memory log sink for testing.
StructuredLogger
Structured logger with trace correlation.
TraceContext
Thread-local trace context for correlation.

Enums§

LogLevel
Log severity levels.
LogOutput
Log output format.
LogValue
Log field value types.

Traits§

LogSink
Trait for log output destinations.

Functions§

debug
Log at debug level.
error
Log at error level.
fatal
Log at fatal level.
info
Log at info level.
init
Initialize the global logger.
logger
Get the global logger.
trace
Log at trace level.
warn
Log at warn level.