1
0
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:
Jordi Boggiano
2015-10-14 13:47:31 +01:00
parent 5405308eb1
commit ce293c745a

View File

@@ -174,9 +174,11 @@ class ErrorHandler
array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line']) array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'])
); );
foreach ($this->logger->getHandlers() as $handler) { if ($this->logger instanceof Logger) {
if ($handler instanceof AbstractHandler) { foreach ($this->logger->getHandlers() as $handler) {
$handler->close(); if ($handler instanceof AbstractHandler) {
$handler->close();
}
} }
} }
} }