InitializeAll() private method

private InitializeAll ( ) : void
return void
Example #1
0
        public void CheckAllTargets()
        {
            var config = new LoggingConfiguration();
            var fileTarget = new FileTarget {Name = "File", FileName = "file"};
            config.AddRuleForOneLevel(LogLevel.Error, fileTarget, "*a");

            config.AddTarget(fileTarget);

            Assert.Equal(1, config.AllTargets.Count);
            Assert.Equal(fileTarget, config.AllTargets[0]);

            config.InitializeAll();

            Assert.Equal(1, config.AllTargets.Count);
            Assert.Equal(fileTarget, config.AllTargets[0]);
        }
Example #2
0
        internal void ReconfigExistingLoggers(LoggingConfiguration configuration)
        {
            if (configuration != null)
                configuration.InitializeAll();

            foreach (var loggerWrapper in _loggerCache.Values.ToList())
            {
                Logger logger = loggerWrapper.Target as Logger;
                if (logger != null)
                    logger.SetConfiguration(GetConfigurationForLogger(logger.Name, configuration));
            }
        }