pub struct RequestLogger { /* private fields */ }Expand description
A request logger that tracks timing and logs responses.
Use this for complete request/response logging with timing information.
Implementations§
Source§impl RequestLogger
impl RequestLogger
Sourcepub fn with_config(config: LoggingConfig) -> Self
pub fn with_config(config: LoggingConfig) -> Self
Create a request logger with custom configuration.
Sourcepub fn metrics(&self) -> &InterceptorMetrics
pub fn metrics(&self) -> &InterceptorMetrics
Get the metrics.
Sourcepub fn start(&self, method: &str) -> RequestSpan
pub fn start(&self, method: &str) -> RequestSpan
Start tracking a request.
Sourcepub fn finish_success(&self, span: RequestSpan)
pub fn finish_success(&self, span: RequestSpan)
Finish tracking a request (success).
Sourcepub fn finish_error(&self, span: RequestSpan, error: &str)
pub fn finish_error(&self, span: RequestSpan, error: &str)
Finish tracking a request (failure).
Trait Implementations§
Source§impl Debug for RequestLogger
impl Debug for RequestLogger
Auto Trait Implementations§
impl !Freeze for RequestLogger
impl RefUnwindSafe for RequestLogger
impl Send for RequestLogger
impl Sync for RequestLogger
impl Unpin for RequestLogger
impl UnwindSafe for RequestLogger
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request