Azavea.NijPredictivePolicing.AcsAlchemistGui.FormController.InitLogging C# (CSharp) Метод

InitLogging() приватный Метод

private InitLogging ( IAppender appenderObj ) : void
appenderObj IAppender
Результат void
        internal void InitLogging(IAppender appenderObj)
        {
            if (_log != null)
            {
                _log.Debug("Logging already initialized");
                return;
            }

            try
            {
                //attempt to load logging configuration
                System.IO.FileInfo configFile = new System.IO.FileInfo(Path.Combine(Settings.ApplicationPath, "Logging.config"));
                log4net.Config.XmlConfigurator.ConfigureAndWatch(configFile);
                _log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            }
            catch
            {
                ConsoleAppender con = new ConsoleAppender();
                con.Layout = new PatternLayout("%message%newline");
                //con.Threshold = log4net.Core.Level.Info;
                log4net.Config.BasicConfigurator.Configure(con);
                _log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            }

            if (appenderObj != null)
            {
                ((log4net.Repository.Hierarchy.Hierarchy)log4net.LogManager.GetLoggerRepository()).Root.AddAppender(appenderObj);
            }
        }