pub struct RequestResponseLogger { /* private fields */ }Expand description
Middleware that logs requests and responses with configurable redaction.
Implementations§
Source§impl RequestResponseLogger
impl RequestResponseLogger
Sourcepub fn log_config(self, config: LogConfig) -> Self
pub fn log_config(self, config: LogConfig) -> Self
Override the logging configuration.
Sourcepub fn log_request_headers(self, enabled: bool) -> Self
pub fn log_request_headers(self, enabled: bool) -> Self
Enable or disable request header logging.
Sourcepub fn log_response_headers(self, enabled: bool) -> Self
pub fn log_response_headers(self, enabled: bool) -> Self
Enable or disable response header logging.
Sourcepub fn max_body_bytes(self, max: usize) -> Self
pub fn max_body_bytes(self, max: usize) -> Self
Set the maximum number of body bytes to include in logs.
Sourcepub fn redact_header(self, name: impl Into<String>) -> Self
pub fn redact_header(self, name: impl Into<String>) -> Self
Add a header name to redact (case-insensitive).
Trait Implementations§
Source§impl Clone for RequestResponseLogger
impl Clone for RequestResponseLogger
Source§fn clone(&self) -> RequestResponseLogger
fn clone(&self) -> RequestResponseLogger
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 RequestResponseLogger
impl Debug for RequestResponseLogger
Source§impl Default for RequestResponseLogger
impl Default for RequestResponseLogger
Source§impl Middleware for RequestResponseLogger
impl Middleware for RequestResponseLogger
Source§fn before<'a>(
&'a self,
ctx: &'a RequestContext,
req: &'a mut Request,
) -> BoxFuture<'a, ControlFlow>
fn before<'a>( &'a self, ctx: &'a RequestContext, req: &'a mut Request, ) -> BoxFuture<'a, ControlFlow>
Called before the handler executes. Read more
Auto Trait Implementations§
impl Freeze for RequestResponseLogger
impl RefUnwindSafe for RequestResponseLogger
impl Send for RequestResponseLogger
impl Sync for RequestResponseLogger
impl Unpin for RequestResponseLogger
impl UnwindSafe for RequestResponseLogger
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).