pub struct TracingConfig {
pub trace_bodies: bool,
pub trace_response_bodies: bool,
pub max_body_size: usize,
pub level: Level,
pub include_sensitive_headers: bool,
pub sensitive_headers: Vec<String>,
}
Expand description
Configuration for tracing middleware
Fields§
§trace_bodies: bool
Whether to trace request bodies
trace_response_bodies: bool
Whether to trace response bodies
max_body_size: usize
Maximum body size to trace (in bytes)
level: Level
Log level for requests
include_sensitive_headers: bool
Whether to include sensitive headers in traces
sensitive_headers: Vec<String>
Headers considered sensitive (will be redacted)
Implementations§
Source§impl TracingConfig
impl TracingConfig
Sourcepub fn with_body_tracing(self) -> Self
pub fn with_body_tracing(self) -> Self
Enable body tracing
Sourcepub fn with_response_body_tracing(self) -> Self
pub fn with_response_body_tracing(self) -> Self
Enable response body tracing
Sourcepub fn with_max_body_size(self, size: usize) -> Self
pub fn with_max_body_size(self, size: usize) -> Self
Set maximum body size for tracing
Sourcepub fn with_level(self, level: Level) -> Self
pub fn with_level(self, level: Level) -> Self
Set tracing level
Sourcepub fn with_sensitive_headers(self) -> Self
pub fn with_sensitive_headers(self) -> Self
Include sensitive headers in traces (not recommended for production)
Sourcepub fn add_sensitive_header(self, header: String) -> Self
pub fn add_sensitive_header(self, header: String) -> Self
Add custom sensitive header
Trait Implementations§
Source§impl Clone for TracingConfig
impl Clone for TracingConfig
Source§fn clone(&self) -> TracingConfig
fn clone(&self) -> TracingConfig
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 TracingConfig
impl Debug for TracingConfig
Auto Trait Implementations§
impl Freeze for TracingConfig
impl RefUnwindSafe for TracingConfig
impl Send for TracingConfig
impl Sync for TracingConfig
impl Unpin for TracingConfig
impl UnwindSafe for TracingConfig
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