pub struct LoggingConfig {
pub structured: bool,
pub log_request_body: bool,
pub log_response_body: bool,
pub log_request_headers: bool,
pub log_response_headers: bool,
pub correlation_ids: bool,
pub tracing_spans: bool,
pub slow_request_threshold: Duration,
pub correlation_header: String,
pub custom_fields: HashMap<String, String>,
}Expand description
Configuration for enhanced logging middleware
Fields§
§structured: boolEnable structured JSON logging
log_request_body: boolLog request body (be careful with sensitive data)
log_response_body: boolLog response body (be careful with sensitive data)
log_request_headers: boolLog request headers (sensitive headers are always filtered)
log_response_headers: boolLog response headers
correlation_ids: boolEnable request correlation ID tracking
tracing_spans: boolEnable request tracing spans
slow_request_threshold: DurationSlow request threshold (requests slower than this will be logged as warnings)
correlation_header: StringCustom header name for correlation ID (defaults to “X-Correlation-ID”)
custom_fields: HashMap<String, String>Additional custom fields to include in structured logs
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