pub struct StructuredJsonLogger { /* private fields */ }Expand description
Structured JSON logger for durable execution.
Emits one JSON object per line to stdout. Each entry includes execution
context from JsonLogContext and optional operation metadata extracted
from LogInfo.
§Level Filtering
The min_level field controls which messages are emitted. Messages with
a level below min_level are silently dropped.
Implementations§
Source§impl StructuredJsonLogger
impl StructuredJsonLogger
Sourcepub fn new(min_level: LogLevel) -> Self
pub fn new(min_level: LogLevel) -> Self
Creates a new StructuredJsonLogger with the given minimum log level.
No execution context is set initially — call set_context
to attach request and execution metadata.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates a new StructuredJsonLogger with min_level derived from the
AWS_LAMBDA_LOG_LEVEL environment variable.
Valid values (case-insensitive): "DEBUG", "INFO", "WARN", "ERROR".
If the variable is not set or contains an invalid value, defaults to
LogLevel::Debug (all messages emitted).
Sourcepub fn set_context(&mut self, context: JsonLogContext)
pub fn set_context(&mut self, context: JsonLogContext)
Sets the execution context for all subsequent log entries.
Trait Implementations§
Source§impl Logger for StructuredJsonLogger
impl Logger for StructuredJsonLogger
Auto Trait Implementations§
impl Freeze for StructuredJsonLogger
impl RefUnwindSafe for StructuredJsonLogger
impl Send for StructuredJsonLogger
impl Sync for StructuredJsonLogger
impl Unpin for StructuredJsonLogger
impl UnsafeUnpin for StructuredJsonLogger
impl UnwindSafe for StructuredJsonLogger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more