public void Error(string message) { if (IsErrorEnabled) { _logger.Error(message); } }
/// <summary> /// 记录错误信息到日志。 /// </summary> /// <param name="message">要记录的信息。</param> /// <param name="exception">异常对象。</param> public void Error(object message, Exception exception = null) { if (LogEnvironment.IsConfigured(LogLevel.Error)) { _logger.Error(exception, message?.ToString()); } }
/// <summary> /// Logs the specified information. /// </summary> /// <param name="entry"></param> public void Log(LogEntry entry) { switch (entry.Severity) { case LogLevel.Information: { logger.Info(entry.Exception, entry.Message); break; } case LogLevel.Debug: { logger.Debug(entry.Exception, entry.Message); break; } case LogLevel.Warning: { logger.Warn(entry.Exception, entry.Message); break; } case LogLevel.Error: { logger.Error(entry.Exception, entry.Message); break; } default: { logger.Fatal(entry.Exception, entry.Message); break; } } }
public void Log(LogEntry entry) { switch (entry.Severity) { case LoggingEventType.Information when IsEnabledFor(LoggingEventType.Information): _logger.Info(entry.Exception, entry.Message); break; case LoggingEventType.Debug when IsEnabledFor(LoggingEventType.Debug): _logger.Debug(entry.Exception, entry.Message); break; case LoggingEventType.Warning when IsEnabledFor(LoggingEventType.Warning): _logger.Warn(entry.Exception, entry.Message); break; case LoggingEventType.Error when IsEnabledFor(LoggingEventType.Error): _logger.Error(entry.Exception, entry.Message); break; case LoggingEventType.Fatal when IsEnabledFor(LoggingEventType.Fatal): _logger.Fatal(entry.Exception, entry.Message); break; case LoggingEventType.Trace when IsEnabledFor(LoggingEventType.Trace): _logger.Trace(entry.Exception, entry.Message); break; default: throw new ArgumentOutOfRangeException(); } }
public void Error(Exception exception, string messageTemplate, params object[] propertyValues) { var message = string.Format(messageTemplate, propertyValues); _logger.Error(exception, CreateMessage(message)); }
/// <summary> /// 记录错误信息到日志。 /// </summary> /// <param name="message">要记录的信息。</param> /// <param name="exception">异常对象。</param> public void Error(object message, Exception exception = null) { log.Error(exception, message?.ToString()); }
public void Error(string s) { _logger.Error(s); }
/// <summary> /// Log error messages. /// </summary> /// <param name="format">The message format string.</param> /// <param name="arguments">The message format argument array.</param> public override void Error(string format, params object[] arguments) { _logger.Error(format, arguments); }
public void LogError(string message, Exception exception) { _nlog.Error(exception, message); }
/// <summary> /// 记录错误信息到日志。 /// </summary> /// <param name="message">要记录的信息。</param> /// <param name="exception">异常对象。</param> public void Error(string message, Exception exception = null) { log.Error(exception, message); }
public void Error(string message, Exception exception) { _logger.Error(exception, message); }
public void Error <T>(T value) { mLogger.Error(value); }
public void Error(Exception exception, string messageTemplate, params object[] propertyValues) { _logger.Error(exception, messageTemplate, propertyValues); }