pub struct LoggingLayer {
pub log_bodies: bool,
pub max_body_log_bytes: usize,
}Expand description
Logs request/response pairs as structured JSON via tracing.
Fields§
§log_bodies: boolWhether to include body content in logs.
max_body_log_bytes: usizeMaximum body bytes to include in log output.
Implementations§
Source§impl LoggingLayer
impl LoggingLayer
pub fn new() -> Self
pub fn with_bodies(self, enabled: bool) -> Self
pub fn with_max_body_bytes(self, max: usize) -> Self
Trait Implementations§
Source§impl Default for LoggingLayer
impl Default for LoggingLayer
Source§impl ProxyLayer for LoggingLayer
impl ProxyLayer for LoggingLayer
Source§fn on_request<'life0, 'async_trait>(
&'life0 self,
request: ProxyRequest,
) -> Pin<Box<dyn Future<Output = ProxyResult<LayerAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_request<'life0, 'async_trait>(
&'life0 self,
request: ProxyRequest,
) -> Pin<Box<dyn Future<Output = ProxyResult<LayerAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process an incoming request. Return
Forward to pass it on,
or Respond to short-circuit with an immediate response.Source§fn on_response<'life0, 'async_trait>(
&'life0 self,
response: ProxyResponse,
) -> Pin<Box<dyn Future<Output = ProxyResult<ProxyResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_response<'life0, 'async_trait>(
&'life0 self,
response: ProxyResponse,
) -> Pin<Box<dyn Future<Output = ProxyResult<ProxyResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process a response before it’s sent back to the client.
Called in reverse layer order.
Auto Trait Implementations§
impl Freeze for LoggingLayer
impl RefUnwindSafe for LoggingLayer
impl Send for LoggingLayer
impl Sync for LoggingLayer
impl Unpin for LoggingLayer
impl UnsafeUnpin for LoggingLayer
impl UnwindSafe for LoggingLayer
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