private Exceptionless.Logging.LogLevel convertLevel(LogLevel level) { Exceptionless.Logging.LogLevel result = Exceptionless.Logging.LogLevel.Other; switch (level) { case LogLevel.Information: result = Exceptionless.Logging.LogLevel.Info; break; case LogLevel.Error: result = Exceptionless.Logging.LogLevel.Error; break; case LogLevel.Warning: result = Exceptionless.Logging.LogLevel.Warn; break; case LogLevel.Critical: result = Exceptionless.Logging.LogLevel.Fatal; break; case LogLevel.Debug: result = Exceptionless.Logging.LogLevel.Debug; break; case LogLevel.Trace: result = Exceptionless.Logging.LogLevel.Trace; break; default: break; } return(result); }
public static ILoggingBuilder AddExceptionless( this ILoggingBuilder logging, IConfiguration configuration, Action <ExceptionlessConfiguration> configure) { return(logging.AddProvider(new ExceptionlessLoggerProvider(config => { if (configuration != null) { config.ReadFromConfiguration(configuration); config.SetDefaultMinLogLevel(ExceptionlessLogLevel.FromString(configuration.GetValue("LogLevel", "Error"))); } configure(config); }))); }