pub struct LogContextConfig { /* private fields */ }Expand description
Parsed log-context template (Java LogContextConfig) — the application’s
app-log-context.yaml when present, otherwise the built-in default.
Implementations§
Source§impl LogContextConfig
impl LogContextConfig
Sourcepub fn instance() -> &'static LogContextConfig
pub fn instance() -> &'static LogContextConfig
The lazily-loaded singleton; touching AppConfigReader first
guarantees ${ENV:default} substitution works regardless of timing
(Java parity).
Sourcepub fn from_reader(reader: &ConfigReader) -> Self
pub fn from_reader(reader: &ConfigReader) -> Self
Build a config from a loaded reader. Public so tests and tooling can exercise the enabled/disabled paths deterministically (the Java package-private constructor’s analog).
pub fn is_enabled(&self) -> bool
Sourcepub fn render(
&self,
state: &TraceState,
log_time: SystemTime,
) -> Map<String, Value>
pub fn render( &self, state: &TraceState, log_time: SystemTime, ) -> Map<String, Value>
Build the context block for one log line (Java render): reserved
tokens resolved live, constants, then the developer’s custom keys.
Keys resolving to nothing are omitted.
state is the current trace bracket — the context block exists ONLY
for a log line emitted inside a traced function execution with a real
request trace (Java parity: the log context is registered per worker
execution in lockstep with the trace bracket; framework, system and
telemetry lines carry no context at all, not even the constants).