mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Do not assume we have a Logger in ErrorHandler, fixes #666
This commit is contained in:
@@ -174,9 +174,11 @@ class ErrorHandler
|
||||
array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'])
|
||||
);
|
||||
|
||||
foreach ($this->logger->getHandlers() as $handler) {
|
||||
if ($handler instanceof AbstractHandler) {
|
||||
$handler->close();
|
||||
if ($this->logger instanceof Logger) {
|
||||
foreach ($this->logger->getHandlers() as $handler) {
|
||||
if ($handler instanceof AbstractHandler) {
|
||||
$handler->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user