src/Arcus.Shared/Observability/Sinks/Converters/CustomApplicationInsightsTelemetryConverter.cs
/// <summary>
///     Convert the given <paramref name="logEvent"/> to a series of <see cref="ITelemetry"/> instances.
/// </summary>
/// <param name="logEvent">The event containing all relevant information for an <see cref="ITelemetry"/> instance.</param>
/// <param name="formatProvider">The instance to control formatting.</param>
Convert the given  to a series of  instances.
Convert the given to a series of instances .
public override IEnumerable<ITelemetry> Convert(LogEvent logEvent, IFormatProvider formatProvider)
        {
            if (logEvent.Exception != null)
            {
                return _exceptionTelemetryConverter.Convert(logEvent, formatProvider);
            }
            if (logEvent.MessageTemplate.Text.StartsWith(MessagePrefixes.RequestViaHttp))
            {
                return _requestTelemetryConverter.Convert(logEvent, formatProvider);
            }
            if (logEvent.MessageTemplate.Text.StartsWith(MessagePrefixes.Dependency))
            {
                return _superCustomDependencyTelemetryConverter.Convert(logEvent, formatProvider);
            }
            if (logEvent.MessageTemplate.Text.StartsWith(MessagePrefixes.DependencyViaHttp))
            {
                return _httpDependencyTelemetryConverter.Convert(logEvent, formatProvider);
            }
            if (logEvent.MessageTemplate.Text.StartsWith(MessagePrefixes.DependencyViaSql))
            {
                return _sqlDependencyTelemetryConverter.Convert(logEvent, formatProvider);
            }
            if (logEvent.MessageTemplate.Text.StartsWith(MessagePrefixes.Event))
            {
                return _eventTelemetryConverter.Convert(logEvent, formatProvider);
            }
            if (logEvent.MessageTemplate.Text.StartsWith(MessagePrefixes.Metric))
            {
                return _metricTelemetryConverter.Convert(logEvent, formatProvider);
            }
            return _traceTelemetryConverter.Convert(logEvent, formatProvider);
        }
public override IEnumerable < ITelemetry > Convert ( LogEvent logEvent , IFormatProvider formatProvider ) { if ( logEvent . Exception != null ) { return _exceptionTelemetryConverter . Convert ( logEvent , formatProvider ) ; } if ( logEvent . MessageTemplate . Text . StartsWith ( MessagePrefixes . RequestViaHttp ) ) { return _requestTelemetryConverter . Convert ( logEvent , formatProvider ) ; } if ( logEvent . MessageTemplate . Text . StartsWith ( MessagePrefixes . Dependency ) ) { return _superCustomDependencyTelemetryConverter . Convert ( logEvent , formatProvider ) ; } if ( logEvent . MessageTemplate . Text . StartsWith ( MessagePrefixes . DependencyViaHttp ) ) { return _httpDependencyTelemetryConverter . Convert ( logEvent , formatProvider ) ; } if ( logEvent . MessageTemplate . Text . StartsWith ( MessagePrefixes . DependencyViaSql ) ) { return _sqlDependencyTelemetryConverter . Convert ( logEvent , formatProvider ) ; } if ( logEvent . MessageTemplate . Text . StartsWith ( MessagePrefixes . Event ) ) { return _eventTelemetryConverter . Convert ( logEvent , formatProvider ) ; } if ( logEvent . MessageTemplate . Text . StartsWith ( MessagePrefixes . Metric ) ) { return _metricTelemetryConverter . Convert ( logEvent , formatProvider ) ; } return _traceTelemetryConverter . Convert ( logEvent , formatProvider ) ; }
Convert the given  to a series of  instances.
Convert the given to a series of instances .
logEvent
LogEvent
The event containing all relevant information for an  instance.
The event containing all relevant information for an instance .
formatProvider
IFormatProvider
The instance to control formatting.
The instance to control formatting .