public static ToSelfAppender StartAppending(string loggerName = "NHibernate.SQL", bool addStack = true)
        {
            var appender = new ToSelfAppender()
            {
                AddStack = addStack, LoggerName = loggerName
            };

            Logger logger = (Logger)LogManager.GetLogger(loggerName).Logger;

            logger.Level = Level.All;
            logger.AddAppender(appender);

            logger.Level = logger.Hierarchy.LevelMap["DEBUG"];
            BasicConfigurator.Configure(logger.Repository);

            return(appender);
        }
Esempio n. 2
0
		private void StopAppending(ToSelfAppender appender)
		{
			Logger logger = (Logger)LogManager.GetLogger(appender.LoggerName).Logger;
			logger.RemoveAppender(appender);
		}
Esempio n. 3
0
		public static ToSelfAppender StartAppending(string loggerName = "NHibernate.SQL", bool addStack = true)
		{
			var appender = new ToSelfAppender() { AddStack = addStack, LoggerName = loggerName };

			Logger logger = (Logger)LogManager.GetLogger(loggerName).Logger;
			logger.Level = Level.All;
			logger.AddAppender(appender);

			logger.Level = logger.Hierarchy.LevelMap["DEBUG"];
			BasicConfigurator.Configure(logger.Repository);

			return appender;
		}
        private void StopAppending(ToSelfAppender appender)
        {
            Logger logger = (Logger)LogManager.GetLogger(appender.LoggerName).Logger;

            logger.RemoveAppender(appender);
        }