pub struct LoggingSetup<'a> {
pub config: &'a LoggingConfig,
pub sampling: Option<&'a SamplingConfig>,
pub module_levels: Option<&'a HashMap<String, String>>,
pub masking: Option<&'a MaskingConfig>,
pub otlp: Option<&'a OtlpConfig>,
pub service_name: &'a str,
pub environment: &'a str,
pub version: &'a str,
}Expand description
Options for init_logging_full.
Fields§
§config: &'a LoggingConfigBase logging configuration.
sampling: Option<&'a SamplingConfig>Optional rate-based sampling configuration.
module_levels: Option<&'a HashMap<String, String>>Optional per-module level overrides.
masking: Option<&'a MaskingConfig>Optional sensitive data masking configuration.
otlp: Option<&'a OtlpConfig>Optional OTLP exporter configuration.
service_name: &'a strService name reported to OpenTelemetry.
environment: &'a strDeployment environment reported to OpenTelemetry.
version: &'a strService version reported to OpenTelemetry.
Implementations§
Source§impl<'a> LoggingSetup<'a>
impl<'a> LoggingSetup<'a>
Sourcepub const fn new(
config: &'a LoggingConfig,
service_name: &'a str,
environment: &'a str,
version: &'a str,
) -> Self
pub const fn new( config: &'a LoggingConfig, service_name: &'a str, environment: &'a str, version: &'a str, ) -> Self
Create full logging setup options with no optional layers enabled.
Sourcepub const fn with_sampling(self, sampling: &'a SamplingConfig) -> Self
pub const fn with_sampling(self, sampling: &'a SamplingConfig) -> Self
Add rate-based sampling.
Sourcepub const fn with_module_levels(
self,
module_levels: &'a HashMap<String, String>,
) -> Self
pub const fn with_module_levels( self, module_levels: &'a HashMap<String, String>, ) -> Self
Add per-module log level overrides.
Sourcepub const fn with_masking(self, masking: &'a MaskingConfig) -> Self
pub const fn with_masking(self, masking: &'a MaskingConfig) -> Self
Add sensitive data masking.
Sourcepub const fn with_otlp(self, otlp: &'a OtlpConfig) -> Self
pub const fn with_otlp(self, otlp: &'a OtlpConfig) -> Self
Add OTLP export.
Auto Trait Implementations§
impl<'a> Freeze for LoggingSetup<'a>
impl<'a> RefUnwindSafe for LoggingSetup<'a>
impl<'a> Send for LoggingSetup<'a>
impl<'a> Sync for LoggingSetup<'a>
impl<'a> Unpin for LoggingSetup<'a>
impl<'a> UnsafeUnpin for LoggingSetup<'a>
impl<'a> UnwindSafe for LoggingSetup<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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