mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-11 07:34:12 +02:00
Prevent throwing an exception in the case that the fatal error level is not set.
This commit is contained in:
@@ -92,7 +92,7 @@ class ErrorHandler
|
|||||||
register_shutdown_function(array($this, 'handleFatalError'));
|
register_shutdown_function(array($this, 'handleFatalError'));
|
||||||
|
|
||||||
$this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
|
$this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
|
||||||
$this->fatalLevel = $level === null ? LogLevel::ALERT : $level;
|
$this->fatalLevel = $level;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function defaultErrorLevelMap()
|
protected function defaultErrorLevelMap()
|
||||||
@@ -157,7 +157,7 @@ class ErrorHandler
|
|||||||
$lastError = error_get_last();
|
$lastError = error_get_last();
|
||||||
if ($lastError && in_array($lastError['type'], self::$fatalErrors)) {
|
if ($lastError && in_array($lastError['type'], self::$fatalErrors)) {
|
||||||
$this->logger->log(
|
$this->logger->log(
|
||||||
$this->fatalLevel,
|
$this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel,
|
||||||
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
|
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
|
||||||
array('file' => $lastError['file'], 'line' => $lastError['line'])
|
array('file' => $lastError['file'], 'line' => $lastError['line'])
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user