mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-02 11:20:31 +02:00
Close handlers that can be closed after logging a fatal errors, refs #621
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Monolog;
|
|||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Psr\Log\LogLevel;
|
use Psr\Log\LogLevel;
|
||||||
|
use Monolog\Handler\AbstractHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monolog error handler
|
* Monolog error handler
|
||||||
@@ -167,6 +168,12 @@ class ErrorHandler
|
|||||||
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
|
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
|
||||||
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 ($handler instanceof AbstractHandler) {
|
||||||
|
$handler->close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user