예제 #1
0
        /// <summary>
        /// Debug 调试信息
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        public static void Debug(object message, Exception ex, string category = null, bool additivity = false)
        {
            HandMessage(message, ex);
            string loggerName = GetLoggerName("Debug", category);
            ILog   logger     = CustomRollingFileLogger.GetCustomLogger(loggerName, GetCategory("Debug", category));

            logger.Debug(message, ex);
        }
예제 #2
0
        /// <summary>
        /// DebugFormat 调试信息
        /// </summary>
        /// <param name="format"></param>
        /// <param name="args"></param>
        public static void DebugFormat(string format, string category = null, bool additivity = false, params object[] args)
        {
            HandMessage(format, args);
            string loggerName = GetLoggerName("Debug", category);
            ILog   logger     = CustomRollingFileLogger.GetCustomLogger(loggerName, GetCategory("Debug", category));

            logger.DebugFormat(format, args);
        }
예제 #3
0
        /// <summary>
        /// Error 一般错误
        /// </summary>
        /// <param name="message"></param>
        /// <param name="category"></param>
        /// <param name="additivity"></param>
        public static void Error(object message, string category = null, bool additivity = false)
        {
            HandMessage(message);
            string loggerName = GetLoggerName("Error", category);
            ILog   logger     = CustomRollingFileLogger.GetCustomLogger(loggerName, GetCategory("Error", category));

            logger.Error(message);
        }
예제 #4
0
        /// <summary>
        /// Info 一般信息
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <param name="category"></param>
        /// <param name="additivity"></param>
        public static void Info(object message, Exception ex, string category = null, bool additivity = false)
        {
            string loggerName = GetLoggerName("Info", category);
            ILog   logger     = CustomRollingFileLogger.GetCustomLogger(loggerName, GetCategory("Info", category));

            if (logger.IsInfoEnabled)
            {
                logger.Info(message, ex);
            }
        }
예제 #5
0
        /// <summary>
        /// WarnFormat 警告
        /// </summary>
        /// <param name="format"></param>
        /// <param name="category"></param>
        /// <param name="additivity"></param>
        /// <param name="args"></param>
        public static void WarnFormat(string format, string category = null, bool additivity = false, params object[] args)
        {
            HandMessage(format, args);
            string loggerName = GetLoggerName("Warn", category);
            ILog   logger     = CustomRollingFileLogger.GetCustomLogger(loggerName, GetCategory("Warn", category));

            if (logger.IsWarnEnabled)
            {
                logger.WarnFormat(format, args);
            }
        }
예제 #6
0
        /// <summary>
        /// Warn 警告
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <param name="category"></param>
        /// <param name="additivity"></param>
        public static void Warn(object message, Exception ex, string category = null, bool additivity = false)
        {
            HandMessage(message, ex);
            string loggerName = GetLoggerName("Warn", category);
            ILog   logger     = CustomRollingFileLogger.GetCustomLogger(loggerName, GetCategory("Warn", category));

            if (logger.IsWarnEnabled)
            {
                logger.Warn(message, ex);
            }
        }
예제 #7
0
        /// <summary>
        /// Fatal 致命错误
        /// </summary>
        /// <param name="message"></param>
        /// <param name="category"></param>
        /// <param name="additivity"></param>
        public static void Fatal(object message, string category = null, bool additivity = false)
        {
            HandMessage(message);
            string loggerName = GetLoggerName("Fatal", category);
            ILog   logger     = CustomRollingFileLogger.GetCustomLogger(loggerName, GetCategory("Fatal", category));

            if (logger.IsFatalEnabled)
            {
                logger.Fatal(message);
            }
        }