Loading core/lib/Drupal/Core/EventSubscriber/ExceptionLoggingSubscriber.php +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public function onClientError(ExceptionEvent $event) { $error += [ 'status_code' => $exception->getStatusCode(), ]; unset($error['@backtrace_string']); $this->logger->get('client error') ->warning(Error::DEFAULT_ERROR_MESSAGE, $error); } Loading core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php +5 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ public function testExceptionLogging() { foreach ($expected_channels as $key => $expected_channel) { $this->assertEquals($expected_channel, $logs[$key][2]['channel']); $this->assertEquals($expected_levels[$key], $logs[$key][0]); // Verify that @backtrace_string is removed from client error. if ($logs[$key][2]['channel'] === 'client error') { $this->assertArrayNotHasKey('@backtrace_string', $logs[$key][2]); } } } Loading Loading
core/lib/Drupal/Core/EventSubscriber/ExceptionLoggingSubscriber.php +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public function onClientError(ExceptionEvent $event) { $error += [ 'status_code' => $exception->getStatusCode(), ]; unset($error['@backtrace_string']); $this->logger->get('client error') ->warning(Error::DEFAULT_ERROR_MESSAGE, $error); } Loading
core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php +5 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ public function testExceptionLogging() { foreach ($expected_channels as $key => $expected_channel) { $this->assertEquals($expected_channel, $logs[$key][2]['channel']); $this->assertEquals($expected_levels[$key], $logs[$key][0]); // Verify that @backtrace_string is removed from client error. if ($logs[$key][2]['channel'] === 'client error') { $this->assertArrayNotHasKey('@backtrace_string', $logs[$key][2]); } } } Loading