mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
Add 'code', 'message' to ErrorHandler log context.
Passed the 'code' and 'message' from the original error/fatal-error to the context of ErrorHandler log record(s). This will help writers of Handlers to save structured information about errors/fatal-errors. (e.g. Useful for a "DatabaseHandler").
This commit is contained in:
@@ -142,7 +142,7 @@ class ErrorHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
$level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
|
$level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
|
||||||
$this->logger->log($level, self::codeToString($code).': '.$message, array('file' => $file, 'line' => $line));
|
$this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line));
|
||||||
|
|
||||||
if ($this->previousErrorHandler === true) {
|
if ($this->previousErrorHandler === true) {
|
||||||
return false;
|
return false;
|
||||||
@@ -163,7 +163,7 @@ class ErrorHandler
|
|||||||
$this->logger->log(
|
$this->logger->log(
|
||||||
$this->fatalLevel === null ? LogLevel::ALERT : $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('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user