pub struct LoggingConfig {
pub level: String,
pub format: LogFormat,
pub output: LogOutput,
pub show_target: bool,
pub show_thread_ids: bool,
pub show_file_line: bool,
pub show_timestamps: bool,
pub service_name: Option<String>,
pub auto_request_id: bool,
pub request_id_strategy: RequestIdStrategy,
pub request_id_field: String,
}Expand description
Advanced logging configuration
Fields§
§level: String§format: LogFormat§output: LogOutput§show_target: bool§show_thread_ids: bool§show_file_line: bool§show_timestamps: bool§service_name: Option<String>§auto_request_id: bool§request_id_strategy: RequestIdStrategy§request_id_field: StringImplementations§
Source§impl LoggingConfig
impl LoggingConfig
pub fn new() -> Self
pub fn with_level(self, level: impl Into<String>) -> Self
pub fn with_format(self, format: LogFormat) -> Self
pub fn with_output(self, output: LogOutput) -> Self
pub fn with_service_name(self, name: impl Into<String>) -> Self
pub fn show_target(self, show: bool) -> Self
pub fn show_thread_ids(self, show: bool) -> Self
pub fn show_file_line(self, show: bool) -> Self
pub fn show_timestamps(self, show: bool) -> Self
Sourcepub fn with_auto_request_id(self, enabled: bool) -> Self
pub fn with_auto_request_id(self, enabled: bool) -> Self
Enable automatic request ID injection
Sourcepub fn with_request_id_strategy(self, strategy: RequestIdStrategy) -> Self
pub fn with_request_id_strategy(self, strategy: RequestIdStrategy) -> Self
Set request ID generation strategy
Sourcepub fn with_request_id_field(self, field_name: impl Into<String>) -> Self
pub fn with_request_id_field(self, field_name: impl Into<String>) -> Self
Set custom field name for request ID (default: “request_id”)
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 (const: unstable) · 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 UnsafeUnpin 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