/// <summary> /// Initializes a new instance of the <see cref="Hierarchy" /> class with /// the specified <see cref="ILoggerFactory" />. /// </summary> /// <param name="properties">The properties to pass to this repository.</param> /// <param name="loggerFactory">The factory to use to create new logger instances.</param> public Hierarchy(PropertiesCollection properties, ILoggerFactory loggerFactory) : base(properties) { if (loggerFactory == null) { throw new ArgumentNullException("loggerFactory"); } m_defaultFactory = loggerFactory; m_ht = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable()); m_root = new RootLogger(Level.DEBUG); m_root.Hierarchy = this; }
//========================================================= // PRIVATE //========================================================= protected InsideWordWebLog() { _logger = LogManager.GetLogger("InsideWordWeb"); XmlConfigurator.Configure(); _hier = _logger.Logger.Repository as Hierarchy; _root = _hier.Root as RootLogger; // Funky line, but used to normalize the root, current logger // and all it's appenders to the same login threshold. IWThreshold = IWThreshold; IWSmtpThreshold = IWThreshold; _logger.Info("Logging initialized"); MaxBufferSize = 128; _buffer = new Dictionary<string, List<string>>(); _currentFlushWorker = new BackgroundWorker(); _currentFlushWorker.DoWork += DelegateFlushBuffer; _flushQueue = new Queue<string>(); }