pub fn init_logging_full(setup: LoggingSetup<'_>) -> LoggingResult<LoggingGuard>Expand description
Enhanced logging init with all options including OTLP export.
Layers the subscriber stack as follows:
EnvFilter— base level + optional per-module overrides- Optional
SamplingLayer— rate-based log sampling - Format layer (JSON or console)
- Optional
OtlpProviderlayer — bridges events to OTel Logs SDK
The returned LoggingGuard must be held for the lifetime of the service.
When dropped it restores the previous subscriber and (when OTLP is enabled) shuts down the provider,
flushing pending logs.
§Errors
Returns an error if the OTLP provider cannot be created (e.g. invalid endpoint or transport failure), or if a custom masking regex pattern is invalid.