pub struct LoggingMiddleware;Expand description
Logging middleware
Captures request/response metrics and logs them with structured data.
Implementations§
Trait Implementations§
Source§impl Default for LoggingMiddleware
impl Default for LoggingMiddleware
Source§impl Middleware for LoggingMiddleware
impl Middleware for LoggingMiddleware
Source§fn request_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_session: &'life1 mut Session,
ctx: &'life2 mut MiddlewareContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn request_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_session: &'life1 mut Session,
ctx: &'life2 mut MiddlewareContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Record request start time
This captures the request start timestamp in the context for duration calculation in the response phase.
Source§fn response_filter<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
upstream_response: &'life2 mut ResponseHeader,
ctx: &'life3 mut MiddlewareContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn response_filter<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
upstream_response: &'life2 mut ResponseHeader,
ctx: &'life3 mut MiddlewareContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Log request and response details
This is called after the response is received from upstream, capturing all relevant metrics for the access log.
Auto Trait Implementations§
impl Freeze for LoggingMiddleware
impl RefUnwindSafe for LoggingMiddleware
impl Send for LoggingMiddleware
impl Sync for LoggingMiddleware
impl Unpin for LoggingMiddleware
impl UnwindSafe for LoggingMiddleware
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