pub struct LoggingConfig {
pub success_level: LogLevel,
pub error_level: LogLevel,
pub log_metadata: bool,
pub log_path: bool,
pub redact_sensitive: bool,
pub sensitive_headers: Vec<String>,
}Expand description
Configuration for the logging interceptor.
Fields§
§success_level: LogLevelLog level for successful requests.
error_level: LogLevelLog level for failed requests.
log_metadata: boolWhether to log request metadata.
log_path: boolWhether to log request path.
redact_sensitive: boolWhether to redact sensitive headers.
sensitive_headers: Vec<String>List of sensitive header names to redact.
Implementations§
Source§impl LoggingConfig
impl LoggingConfig
Sourcepub fn with_success_level(self, level: LogLevel) -> Self
pub fn with_success_level(self, level: LogLevel) -> Self
Set the success log level.
Sourcepub fn with_error_level(self, level: LogLevel) -> Self
pub fn with_error_level(self, level: LogLevel) -> Self
Set the error log level.
Sourcepub fn with_metadata(self, enabled: bool) -> Self
pub fn with_metadata(self, enabled: bool) -> Self
Enable or disable metadata logging.
Sourcepub fn with_redaction(self, enabled: bool) -> Self
pub fn with_redaction(self, enabled: bool) -> Self
Enable or disable sensitive data redaction.
Sourcepub fn with_sensitive_header(self, header: impl Into<String>) -> Self
pub fn with_sensitive_header(self, header: impl Into<String>) -> Self
Add a sensitive header to redact.
Trait Implementations§
Source§impl Clone for LoggingConfig
impl Clone for LoggingConfig
Source§fn clone(&self) -> LoggingConfig
fn clone(&self) -> LoggingConfig
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 LoggingConfig
impl Debug for LoggingConfig
Auto Trait Implementations§
impl Freeze for LoggingConfig
impl RefUnwindSafe for LoggingConfig
impl Send for LoggingConfig
impl Sync for LoggingConfig
impl Unpin for LoggingConfig
impl UnwindSafe for LoggingConfig
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: 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