1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-07 21:56:31 +02:00

Allow GroupHandler to set a formatter to all nested handlers

This commit is contained in:
Joris Berthelot
2016-01-21 12:50:15 +01:00
parent 6a35f7387b
commit bf82600f0c

View File

@@ -11,6 +11,8 @@
namespace Monolog\Handler;
use Monolog\Formatter\FormatterInterface;
/**
* Forwards records to multiple handlers
*
@@ -77,4 +79,16 @@ class GroupHandler extends AbstractHandler
$handler->handleBatch($records);
}
}
/**
* {@inheritdoc}
*/
public function setFormatter(FormatterInterface $formatter)
{
foreach ($this->handlers as $handler) {
$handler->setFormatter($formatter);
}
return $this;
}
}