Merge pull request #41425 from nextcloud/backport/41406/stable26

[stable26] fix(log): Log exception class when message is empty
This commit is contained in:
Git'Fellow 2023-11-13 16:31:24 +01:00 committed by GitHub
commit 496a68dd41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -338,7 +338,7 @@ class Log implements ILogger, IDataLogger {
unset($data['app']);
unset($data['level']);
$data = array_merge($serializer->serializeException($exception), $data);
$data = $this->interpolateMessage($data, $context['message'] ?? '--', 'CustomMessage');
$data = $this->interpolateMessage($data, isset($context['message']) && $context['message'] !== '' ? $context['message'] : ('Exception thrown: ' . get_class($exception)), 'CustomMessage');
array_walk($context, [$this->normalizer, 'format']);