Add second logging channel

This commit is contained in:
Romain Neutron
2013-07-01 14:38:17 +02:00
parent 24f6f19731
commit ce34bca408
8 changed files with 91 additions and 34 deletions

View File

@@ -37,7 +37,21 @@ abstract class Command extends SymfoCommand
{
if ($input->getOption('verbose')) {
$handler = new StreamHandler('php://stdout');
$this->container['monolog']->pushHandler($handler);
$this->container['monolog'] = $this->container->share(
$this->container->extend('monolog', function($logger, $app) use ($handler) {
$logger->pushHandler($handler);
return $logger;
})
);
$this->container['task-manager.logger'] = $this->container->share(
$this->container->extend('task-manager.logger', function($logger, $app) use ($handler) {
$logger->pushHandler($handler);
return $logger;
})
);
}
return $this->doExecute($input, $output);