1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-01 10:50:21 +02:00

Close handlers that can be closed after logging a fatal errors, refs #621

This commit is contained in:
Jordi Boggiano
2015-08-09 17:29:54 +01:00
parent 3dccef613e
commit 2525053e8e

View File

@@ -13,6 +13,7 @@ namespace Monolog;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Monolog\Handler\AbstractHandler;
/**
* Monolog error handler
@@ -167,6 +168,12 @@ class ErrorHandler
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
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();
}
}
}
}