Source/Serilog.Enrichers.Span/LoggerEnrichmentConfigurationExtensions.cs
/// <summary>
/// Enrich logger output with span information from the current <see cref="Activity"/>.
/// </summary>
/// <param name="loggerEnrichmentConfiguration">The enrichment configuration.</param>
/// <param name="spanOptions"><see cref="SpanOptions"/> to use for enriching Activity.</param>
/// <returns>Configuration object allowing method chaining.</returns>
Enrich logger output with span information from the current .
Enrich logger output with span information from the current .
public static LoggerConfiguration WithSpan(this LoggerEnrichmentConfiguration loggerEnrichmentConfiguration, SpanOptions spanOptions)
        {
            if (loggerEnrichmentConfiguration is null)
            {
                throw new ArgumentNullException(nameof(loggerEnrichmentConfiguration));
            }
            if (spanOptions is null)
            {
                throw new ArgumentNullException(nameof(spanOptions));
            }
            if (spanOptions.IncludeTags)
            {
                loggerEnrichmentConfiguration.With<ActivityTagEnricher>();
            }
            return loggerEnrichmentConfiguration.With<ActivityEnricher>();
        }
public static LoggerConfiguration WithSpan ( this LoggerEnrichmentConfiguration loggerEnrichmentConfiguration , SpanOptions spanOptions ) { if ( loggerEnrichmentConfiguration is null ) { throw new ArgumentNullException ( nameof ( loggerEnrichmentConfiguration ) ) ; } if ( spanOptions is null ) { throw new ArgumentNullException ( nameof ( spanOptions ) ) ; } if ( spanOptions . IncludeTags ) { loggerEnrichmentConfiguration . With < ActivityTagEnricher > ( ) ; } return loggerEnrichmentConfiguration . With < ActivityEnricher > ( ) ; }
Enrich logger output with span information from the current .
Enrich logger output with span information from the current .
Configuration object allowing method chaining.
Configuration object allowing method chaining .
LoggerEnrichmentConfiguration
this
spanOptions
SpanOptions
to use for enriching Activity.
to use for enriching Activity .
loggerEnrichmentConfiguration
The enrichment configuration.
The enrichment configuration .