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§

get_distributed_tracing_context
init
Initialize the logger
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_request_span
parse_traceparent
Parse a traceparent string into its components