pub struct LoggerProviderBuilder { /* private fields */ }Expand description
Builder for provider attributes.
Implementations§
Source§impl LoggerProviderBuilder
impl LoggerProviderBuilder
Sourcepub fn with_simple_exporter<T: LogExporter + 'static>(self, exporter: T) -> Self
pub fn with_simple_exporter<T: LogExporter + 'static>(self, exporter: T) -> Self
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.
Sourcepub fn with_batch_exporter<T: LogExporter + 'static>(self, exporter: T) -> Self
pub fn with_batch_exporter<T: LogExporter + 'static>(self, exporter: T) -> Self
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.
Sourcepub fn with_log_processor<T: LogProcessor + 'static>(self, processor: T) -> Self
pub fn with_log_processor<T: LogProcessor + 'static>(self, processor: T) -> Self
Adds a custom LogProcessor to the pipeline.
§Arguments
processor- TheLogProcessorto be added.
§Returns
A new Builder instance with the custom LogProcessor added to the pipeline.
Processors are invoked in the order they are added.
Sourcepub fn with_resource(self, resource: Resource) -> Self
pub fn with_resource(self, resource: Resource) -> Self
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.
Sourcepub fn build(self) -> SdkLoggerProvider
pub fn build(self) -> SdkLoggerProvider
Create a new provider from this configuration.