mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-24 06:52:34 +01:00
Partially prevent circular references in the handler chain
This commit is contained in:
parent
f4e85e9412
commit
1983270611
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user