Exemple #1
0
        private static Logger GetLoggerFromConfig(string name)
        {
            LoggerConfigurationElement logelement = LoggingSection.GetConfig().Loggers[name];

            ExceptionHelper.FalseThrow(logelement != null, "未能找到名字为:{0}的Logger的配置节", name);
            return(new Logger(logelement.Name, logelement.Enabled));
        }
		/// <summary>
		/// 得到配置节
		/// </summary>
		/// <returns></returns>
		public static LoggingSection GetConfig()
		{
			LoggingSection settings = (LoggingSection)ConfigurationBroker.GetSection("LoggingSettings");

			if (settings == null)
				settings = new LoggingSection();

			return settings;
		}
Exemple #3
0
        /// <summary>
        /// 得到配置节
        /// </summary>
        /// <returns></returns>
        public static LoggingSection GetConfig()
        {
            LoggingSection settings = (LoggingSection)ConfigurationBroker.GetSection("LoggingSettings");

            if (settings == null)
            {
                settings = new LoggingSection();
            }

            return(settings);
        }