/// <summary>
        /// 获取记录级别
        /// </summary>
        /// <returns>记录级别</returns>
        public string GetRecordLevel()
        {
            if (isSet)
            {
                return(level);
            }

            if (string.IsNullOrWhiteSpace(AppConfig["Logging:LogLevel:Default"]))
            {
                if (string.IsNullOrWhiteSpace(AppConfig["HzdtfLog:LogLevel:Default"]))
                {
                    ILogRecordLevel logLevel = new DefaultLogRecordLevel();
                    SetRecordLevel(logLevel.GetRecordLevel());
                }
                else
                {
                    return(AppConfig["HzdtfLog:LogLevel:Default"]);
                }
            }
            else
            {
                return(AppConfig["Logging:LogLevel:Default"]);
            }

            return(level);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 获取默认的记录等级
 /// </summary>
 /// <returns>记录级别</returns>
 protected override string GetDefaultRecordLevel()
 {
     if (string.IsNullOrWhiteSpace(AppConfig["Logging:LogLevel:Default"]))
     {
         if (string.IsNullOrWhiteSpace(AppConfig["HzdtfLog:LogLevel:Default"]))
         {
             ILogRecordLevel logLevel = new DefaultLogRecordLevel();
             return(logLevel.GetRecordLevel());
         }
         else
         {
             return(AppConfig["HzdtfLog:LogLevel:Default"]);
         }
     }
     else
     {
         return(AppConfig["Logging:LogLevel:Default"]);
     }
 }
        /// <summary>
        /// 获取记录级别
        /// </summary>
        /// <returns>记录级别</returns>
        public string GetRecordLevel()
        {
            if (string.IsNullOrWhiteSpace(level))
            {
                if (string.IsNullOrWhiteSpace(AppConfig["HzdtfLog:LogLevel:Default"]))
                {
                    ILogRecordLevel logLevel = new DefaultLogRecordLevel();
                    lock (syncLevel)
                    {
                        level = logLevel.GetRecordLevel();
                    }
                }
                else
                {
                    lock (syncLevel)
                    {
                        level = AppConfig["HzdtfLog:LogLevel:Default"];
                    }
                }
            }

            return(level);
        }