public void TearDown()
 {
     _rep.Shutdown();
     if (File.Exists(GetFilePath()))
     {
         File.Delete(GetFilePath());
     }
 }
예제 #2
0
        public void TestShutdownAndReconfigure()
        {
            // Create unique repository
            ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());

            // Create appender and configure repos
            StringAppender stringAppender = new StringAppender();

            stringAppender.Layout = new PatternLayout("%m");
            BasicConfigurator.Configure(rep, stringAppender);

            // Get logger from repos
            ILog log1 = LogManager.GetLogger(rep.Name, "logger1");

            log1.Info("TestMessage1");
            Assert.AreEqual("TestMessage1", stringAppender.GetString(), "Test logging configured");
            stringAppender.Reset();

            rep.Shutdown();

            log1.Info("TestMessage2");
            Assert.AreEqual("", stringAppender.GetString(), "Test not logging while shutdown");
            stringAppender.Reset();

            // Create new appender and configure
            stringAppender        = new StringAppender();
            stringAppender.Layout = new PatternLayout("%m");
            BasicConfigurator.Configure(rep, stringAppender);

            log1.Info("TestMessage3");
            Assert.AreEqual("TestMessage3", stringAppender.GetString(), "Test logging re-configured");
            stringAppender.Reset();
        }
 protected override void OnStop()
 {
     try
     {
         m_repos.Shutdown();
         ChannelServices.UnregisterChannel(m_remotingChannel);
     }
     catch (Exception)
     {
         //Do Nothing
     }
 }
예제 #4
0
파일: NomadKernel.cs 프로젝트: orb1t/Nomad
        public void Dispose()
        {
            _logger.Debug("Disposing: " + typeof(NomadKernel));

            if (_moduleLoaderCreator != null)
            {
                _moduleLoaderCreator.Dispose();
                _moduleLoaderCreator = null;
            }


            _logger.Debug("Shutting down logger repository");
            if (_repository != null)
            {
                _repository.Shutdown();
                _repository = null;
            }
        }
예제 #5
0
        public void Dispose()
        {
            _logger.Debug("Disposing: " + typeof(ContainerCreator));

            if (_distributedEventAggregatorServiceHost != null)
            {
                _distributedEventAggregatorServiceHost.Close();
                _distributedEventAggregatorServiceHost = null;
            }

            if (_resolver != null)
            {
                _resolver.Dispose();
                _resolver = null;
            }

            _logger.Debug("Shutting down logger repository");
            if (_repository != null)
            {
                _repository.Shutdown();
                _repository = null;
            }
        }
예제 #6
0
        public static void Stop()
        {
            ILoggerRepository repository = LogManager.GetRepository();

            repository.Shutdown();
        }
예제 #7
0
 public void Dispose()
 {
     // Shutdown
     _loggerRepository.Shutdown();
 }
 public void TestFixtureTearDown()
 {
     LogsDBAccess.RemoveMatchingLogEntries(ErrorLevel, ErrorMessage, ApplicationName);
     rep.Shutdown();
 }