Microsoft.ApplicationInsights.Log4NetAppender.ApplicationInsightsAppender.GetSeverityLevel(log4net.Core.Level)

Here are the examples of the csharp api class Microsoft.ApplicationInsights.Log4NetAppender.ApplicationInsightsAppender.GetSeverityLevel(log4net.Core.Level) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: ApplicationInsights-dotnet-logging
Source File: ApplicationInsightsAppender.cs
private void SendException(LoggingEvent loggingEvent)
        {
            try
            {
                var exceptionTelemetry = new ExceptionTelemetry(loggingEvent.ExceptionObject)
                {
                    SeverityLevel = this.GetSeverityLevel(loggingEvent.Level)
                };

                string message = null;
                if (loggingEvent.RenderedMessage != null)
                {
                    message = this.RenderLoggingEvent(loggingEvent);
                }

                if (!string.IsNullOrEmpty(message))
                {
                    exceptionTelemetry.Properties.Add("Message", message);
                }

                this.BuildCustomProperties(loggingEvent, exceptionTelemetry);
                this.telemetryClient.Track(exceptionTelemetry);
            }
            catch (ArgumentNullException exception)
            {
                throw new LogException(exception.Message, exception);
            }
        }

2. Example

Project: ApplicationInsights-dotnet-logging
Source File: ApplicationInsightsAppender.cs
private void SendTrace(LoggingEvent loggingEvent)
        {
            try
            {
                loggingEvent.GetProperties();
                string message = loggingEvent.RenderedMessage != null ? this.RenderLoggingEvent(loggingEvent) : "Log4Net Trace";

                var trace = new TraceTelemetry(message)
                {
                    SeverityLevel = this.GetSeverityLevel(loggingEvent.Level)
                };

                this.BuildCustomProperties(loggingEvent, trace);
                this.telemetryClient.Track(trace);
            }
            catch (ArgumentNullException exception)
            {
                throw new LogException(exception.Message, exception);
            }
        }