Ejemplo n.º 1
0
 function it_throws_an_error_if_a_logging_channel_config_has_no_log_level()
 {
     $config = new Config();
     $config->set(MonologConfig::DEFAULT_CHANNEL_NAME, 'channel_name');
     $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('channel_name'), 'log_path');
     $this->beConstructedWith($config);
     $this->shouldThrow(MissingConfigException::class)->duringInstantiation();
 }
Ejemplo n.º 2
0
 /**
  * @return MonologChannelManager
  */
 private function createChannelManager()
 {
     $config = new Config();
     $config->set(MonologConfig::DEFAULT_CHANNEL_NAME, 'channel');
     $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('channel'), '/tmp');
     $config->set(MonologConfig::LOG_CHANNEL_LOG_LEVEL('channel'), 'debug');
     $monologConfig = new MonologConfig($config);
     return new MonologChannelManager($monologConfig);
 }
 private function createApp()
 {
     $app = new App();
     $config = new Config();
     $config->set(MonologConfig::DEFAULT_CHANNEL_NAME, 'error');
     $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('error'), path(__DIR__, 'error.txt'));
     $config->set(MonologConfig::LOG_CHANNEL_LOG_LEVEL('error'), 'debug');
     $config->set(MonologErrorHandlerConfig::ERROR_CHANNEL_NAME, 'error');
     $app->getConfigLoader()->addConfig($config);
     return $app;
 }
Ejemplo n.º 4
0
 function let()
 {
     $config = new Config();
     $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('channel1'), path('/tmp', uuid(), 'channel1.log'));
     $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('channel2'), path('/tmp', uuid(), 'channel2.log'));
     $config->set(MonologConfig::LOG_CHANNEL_LOG_LEVEL('channel1'), 'debug');
     $config->set(MonologConfig::LOG_CHANNEL_LOG_LEVEL('channel2'), 'debug');
     $config->set(MonologConfig::DEFAULT_CHANNEL_NAME, 'channel1');
     $monologConfig = new MonologConfig($config);
     $this->beConstructedWith($monologConfig);
 }