public void Log(LogEntry logEntry)
{
var formattedLogEntry = logEntry.IncludeExceptionInMessage();
var message = formattedLogEntry.Message;
var exception = formattedLogEntry.Exception;
switch (logEntry.Severity)
{
case LoggingEventType.Debug:
_logger.Debug(exception, message);
break;
case LoggingEventType.Information:
_logger.Info(exception, message);
break;
case LoggingEventType.Warning:
_logger.Warn(exception, message);
break;
case LoggingEventType.Error:
_logger.Error(exception, message);
break;
case LoggingEventType.Fatal:
_logger.Fatal(exception, message);
break;
default:
_logger.Info(exception, message);
break;
}
}