private static NlogLogLevel GetExternalLogLevel(LogLevel level) { switch (level) { case LogLevel.Debug: return(NlogLogLevel.Debug); case LogLevel.Trace: return(NlogLogLevel.Trace); case LogLevel.Information: return(NlogLogLevel.Info); case LogLevel.Warning: return(NlogLogLevel.Warn); case LogLevel.Error: return(NlogLogLevel.Error); case LogLevel.Critical: return(NlogLogLevel.Fatal); } return(NlogLogLevel.Off); }
public void Log(CacheManager.Core.Logging.LogLevel logLevel, int eventId, object message, Exception exception) { if (logLevel == CacheManager.Core.Logging.LogLevel.Warning) { _log.Warn(message, exception); } else if (logLevel == CacheManager.Core.Logging.LogLevel.Critical || logLevel == CacheManager.Core.Logging.LogLevel.Error) { _log.Error(message, exception); } else if (logLevel == CacheManager.Core.Logging.LogLevel.Trace) { _log.Trace(message, exception); } else if (logLevel == CacheManager.Core.Logging.LogLevel.Debug) { _log.Debug(message, exception); } else if (logLevel == CacheManager.Core.Logging.LogLevel.Trace) { _log.Trace(message, exception); } else { _log.Info(message, exception); } }
public bool IsEnabled(CacheManager.Core.Logging.LogLevel logLevel) { return(true); }
public void Log(LogLevel logLevel, int eventId, object message, Exception exception) { //this.logger.Log(GetExternalLogLevel(logLevel), eventId, message, exception, Formatter); this.logger.Log(GetExternalLogLevel(logLevel), exception, message.ToString(), eventId); }
public bool IsEnabled(LogLevel logLevel) { return(this.logger.IsEnabled(GetExternalLogLevel(logLevel))); }