diff --git a/core/includes/errors.inc b/core/includes/errors.inc index 31ed73f..99cab85 100644 --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -159,7 +159,7 @@ function _drupal_log_error($error, $fatal = FALSE) { catch (\Exception $e) { // We can't log, for example because the database connection is not // available. At least try to log to PHP error log. - error_log(sprintf('Failed to log error: %s: %s in %s (line %d of %s).', $error['%type'], $error['!message'], $error['%function'], $error['%line'], $error['%file'])); + error_log(strtr('Failed to log error: %type: !message in %function (line %line of %file).', $error)); } } diff --git a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php index 4d270dd..e61f782 100644 --- a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php +++ b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php @@ -201,7 +201,7 @@ public function testLoggerException() { $this->assertRaw($this->expectedExceptionMessage); // Find fatal error logged to the simpletest error.log - $errors = file(\Drupal::root() . '/' . $this->siteDirectory . '/error.log', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + $errors = file(\Drupal::root() . '/' . $this->siteDirectory . '/error.log'); $this->assertIdentical(count($errors), 1, 'Exactly one line logged to the PHP error log'); $expected_path = \Drupal::root() . '/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php';