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: String
Log level filter (e.g., “info”, “debug”, “warn”)
json_format: bool
Enable JSON structured logging (vs plain text)
pretty_print: bool
Enable pretty printing for development
include_location: bool
Include file and line number information
include_timestamp: bool
Include 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