Struct LoggerProviderBuilder
pub struct LoggerProviderBuilder { /* private fields */ }
Expand description
Builder for provider attributes.
Implementations§
§impl LoggerProviderBuilder
impl LoggerProviderBuilder
pub fn with_simple_exporter<T>(self, exporter: T) -> LoggerProviderBuilderwhere
T: LogExporter + 'static,
pub fn with_simple_exporter<T>(self, exporter: T) -> LoggerProviderBuilderwhere
T: LogExporter + 'static,
Adds a SimpleLogProcessor with the configured exporter to the pipeline.
§Arguments
exporter
- The exporter to be used by the SimpleLogProcessor.
§Returns
A new Builder
instance with the SimpleLogProcessor added to the pipeline.
Processors are invoked in the order they are added.
pub fn with_batch_exporter<T>(self, exporter: T) -> LoggerProviderBuilderwhere
T: LogExporter + 'static,
pub fn with_batch_exporter<T>(self, exporter: T) -> LoggerProviderBuilderwhere
T: LogExporter + 'static,
Adds a BatchLogProcessor with the configured exporter to the pipeline, using the default super::BatchConfig.
The following environment variables can be used to configure the batching configuration:
OTEL_BLRP_SCHEDULE_DELAY
- Corresponds towith_scheduled_delay
.OTEL_BLRP_MAX_QUEUE_SIZE
- Corresponds towith_max_queue_size
.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE
- Corresponds towith_max_export_batch_size
.
§Arguments
exporter
- The exporter to be used by theBatchLogProcessor
.
§Returns
A new LoggerProviderBuilder
instance with the BatchLogProcessor
added to the pipeline.
Processors are invoked in the order they are added.
pub fn with_log_processor<T>(self, processor: T) -> LoggerProviderBuilderwhere
T: LogProcessor + 'static,
pub fn with_log_processor<T>(self, processor: T) -> LoggerProviderBuilderwhere
T: LogProcessor + 'static,
Adds a custom LogProcessor to the pipeline.
§Arguments
processor
- TheLogProcessor
to be added.
§Returns
A new Builder
instance with the custom LogProcessor
added to the pipeline.
Processors are invoked in the order they are added.
pub fn with_resource(self, resource: Resource) -> LoggerProviderBuilder
pub fn with_resource(self, resource: Resource) -> LoggerProviderBuilder
The Resource
to be associated with this Provider.
Note: Calls to this method are additive, each call merges the provided resource with the previous one.
pub fn build(self) -> SdkLoggerProvider
pub fn build(self) -> SdkLoggerProvider
Create a new provider from this configuration.
Trait Implementations§
§impl Debug for LoggerProviderBuilder
impl Debug for LoggerProviderBuilder
§impl Default for LoggerProviderBuilder
impl Default for LoggerProviderBuilder
§fn default() -> LoggerProviderBuilder
fn default() -> LoggerProviderBuilder
Auto Trait Implementations§
impl Freeze for LoggerProviderBuilder
impl !RefUnwindSafe for LoggerProviderBuilder
impl Send for LoggerProviderBuilder
impl Sync for LoggerProviderBuilder
impl Unpin for LoggerProviderBuilder
impl !UnwindSafe for LoggerProviderBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more