mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-16 11:06:27 +02:00
Partially prevent circular references in the handler chain
This commit is contained in:
@ -72,6 +72,9 @@ class Logger
|
||||
public function pushHandler(HandlerInterface $handler)
|
||||
{
|
||||
if ($this->handler) {
|
||||
if ($this->handler === $handler) {
|
||||
throw new \UnexpectedValueException('Circular reference, do not add the same handler instance twice.');
|
||||
}
|
||||
$handler->setParent($this->handler);
|
||||
}
|
||||
$this->handler = $handler;
|
||||
|
Reference in New Issue
Block a user