pub struct LoggingConfig {
pub level: String,
pub json_format: bool,
pub pretty_print: bool,
pub include_location: bool,
pub include_timestamp: bool,
pub global_fields: Map<String, Value>,
pub env_filter: Option<String>,
pub service_name: Option<String>,
pub service_version: Option<String>,
}Expand description
Logging configuration for the elif.rs framework
Fields§
§level: StringLog level filter (e.g., “info”, “debug”, “warn”)
json_format: boolEnable JSON structured logging (vs plain text)
pretty_print: boolEnable pretty printing for development
include_location: boolInclude file and line number information
include_timestamp: boolInclude timestamp in logs
global_fields: Map<String, Value>Custom fields to include in all log entries
env_filter: Option<String>Environment filter (supports complex filters like “elif=debug,tower=info”)
service_name: Option<String>Service name to include in all logs
service_version: Option<String>Service version to include in all logs
Implementations§
Source§impl LoggingConfig
impl LoggingConfig
Sourcepub fn production() -> Self
pub fn production() -> Self
Create production logging configuration
Sourcepub fn development() -> Self
pub fn development() -> Self
Create development logging configuration
Sourcepub fn with_global_field<K, V>(self, key: K, value: V) -> Self
pub fn with_global_field<K, V>(self, key: K, value: V) -> Self
Add a global field to include in all log entries
Sourcepub fn with_service(self, name: &str, version: &str) -> Self
pub fn with_service(self, name: &str, version: &str) -> Self
Set service name and version
Sourcepub fn with_env_filter<S: Into<String>>(self, filter: S) -> Self
pub fn with_env_filter<S: Into<String>>(self, filter: S) -> Self
Set environment filter
Trait Implementations§
Source§impl Clone for LoggingConfig
impl Clone for LoggingConfig
Source§fn clone(&self) -> LoggingConfig
fn clone(&self) -> LoggingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoggingConfig
impl Debug for LoggingConfig
Auto Trait Implementations§
impl Freeze for LoggingConfig
impl RefUnwindSafe for LoggingConfig
impl Send for LoggingConfig
impl Sync for LoggingConfig
impl Unpin for LoggingConfig
impl UnwindSafe for LoggingConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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