Beispiel #1
0
 /**
  * Test if exception serializers propagate to logger level.
  */
 public function testExceptionSerializersPropagateToLogger()
 {
     $factory = new Factory();
     $this->assertCount(0, $factory->getExceptionSerializers());
     $logger = $factory->create('Active Collab', '1.0.0', 'development', LoggerInterface::LOG_FOR_DEBUG, LoggerInterface::FILE, $this->getTestLogsDir());
     $this->assertCount(0, $logger->getExceptionSerializers());
     $factory->addExceptionSerializer(function () {
     });
     $factory->addExceptionSerializer(function () {
     });
     $this->assertCount(2, $factory->getExceptionSerializers());
     $logger = $factory->create('Active Collab', '1.0.0', 'development', LoggerInterface::LOG_FOR_DEBUG, LoggerInterface::FILE, $this->getTestLogsDir());
     $this->assertCount(2, $logger->getExceptionSerializers());
 }
Beispiel #2
0
 /**
  * Test environment arguments, with additional arguments forwarded via logger factory.
  */
 public function testEnvWithAdditionalArguments()
 {
     $factory = new Factory();
     $factory->setAdditionalEnvArguments(['account_id' => 123, 'owner_email' => '*****@*****.**']);
     $logger = $factory->create('Active Collab', '1.0.0', 'development', LoggerInterface::LOG_FOR_DEBUG, LoggerInterface::BLACKHOLE);
     $this->assertArrayHasKey('account_id', $logger->getAppEnv()->getArguments());
     $this->assertArrayHasKey('owner_email', $logger->getAppEnv()->getArguments());
 }