exception: Log fatal exception data as 'exception' instead of 'fatal_exception'

This make it easier to write queries in Logstash given the limited
capabilities of its user interface, so that filters for 'exception.trace'
will also match those of fatal errors.

This has gotten even more confusing in the last week because the fatal
errors logged by /etc/php/php7-fatal-error.php in production did use
'exception.trace' already and that means that the same exact exception
(e.g. "Allowed memory … exhausted" and "Maximum execution time … exceeded")
would sometimes be under 'fatal_exception' and sometimes under 'exception'.

Bug: T233342
Change-Id: I664bfe55359aadb343ee742f59af5f26f4c19339
This commit is contained in:
Timo Tijhof 2019-11-07 17:00:51 -05:00
parent 2c8c7f01bf
commit 115df551f2

View file

@ -323,7 +323,7 @@ TXT;
$trace = debug_backtrace();
$logger = LoggerFactory::getInstance( 'fatal' );
$logger->error( $msg, [
'fatal_exception' => [
'exception' => [
'class' => ErrorException::class,
'message' => "PHP Fatal Error: {$message}",
'code' => $level,