Exemplo n.º 1
0
        public LoggerService()
        {
            //LogManager.ResetConfiguration();
            FileInfo loginfo = new FileInfo("Log4net.config");/// For Application log

            log4net.Config.XmlConfigurator.Configure(loginfo);
            logger = LogManager.GetLogger("root");//<root> from log4net.config
            // setting log level once app is launched. faster. /// need a restart if you want to change level
            // If you want to set level without restart. Move following code under each method. It will be slower.
            //IConfigService confService = LifetimeService.Instance.Container.Resolve<IConfigService>();//23nov2012
            //loglevel = GetEnumLogLevelFromString(confService.GetConfigValueForKey("loglevel"));
            loglevel = ConfigLogLevelEnum.Error;//set default level. After config loads set user's level from it.
        }
Exemplo n.º 2
0
        public void SetLogLevelFromConfig()
        {
            IConfigService confService = LifetimeService.Instance.Container.Resolve <IConfigService>();//23nov2012

            loglevel = GetEnumLogLevelFromString(confService.GetConfigValueForKey("loglevel"));
        }