Module logging

Module logging 

Source
Expand description

Dynamo Distributed Logging Module.

  • Configuration loaded from:
    1. Environment variables (highest priority).
    2. Optional TOML file pointed to by the DYN_LOGGING_CONFIG_PATH environment variable.
    3. /opt/dynamo/etc/logging.toml.

Logging can take two forms: READABLE or JSONL. The default is READABLE. JSONL can be enabled by setting the DYN_LOGGING_JSONL environment variable to 1.

To use local timezone for logging timestamps, set the DYN_LOG_USE_LOCAL_TZ environment variable to 1.

Filters can be configured using the DYN_LOG environment variable or by setting the filters key in the TOML configuration file. Filters are comma-separated key-value pairs where the key is the crate or module name and the value is the log level. The default log level is info.

Example:

log_level = "error"

[log_filters]
"test_logging" = "info"
"test_logging::api" = "trace"

Structs§

DistributedTraceContext
DistributedTraceIdLayer
FieldVisitor
TraceParent

Traits§

GenericHeaders

Functions§

extract_otel_context_from_nats_headers
Extract OpenTelemetry trace context from NATS headers for distributed tracing
get_distributed_tracing_context
init
Initialize the logger - must be called when Tokio runtime is available
inject_current_trace_into_nats_headers
Inject trace context from current span into NATS headers
inject_otel_context_into_nats_headers
Inject OpenTelemetry trace context into NATS headers using W3C Trace Context propagation
inject_trace_headers_into_map
is_valid_span_id
Validate a given span ID according to W3C Trace Context specifications. A valid span ID is a 16-character hexadecimal string (lowercase).
is_valid_trace_id
Validate a given trace ID according to W3C Trace Context specifications. A valid trace ID is a 32-character hexadecimal string (lowercase).
log_message
Log a message with file and line info Used by Python wrapper
make_client_request_span
Create a client_request span linked to the parent trace context
make_handle_payload_span
Create a handle_payload span from NATS headers with component context
make_request_span
parse_traceparent
Parse a traceparent string into its components