Merge pull request #41427 from nextcloud/backport/41406/stable27

[stable27] fix(log): Log exception class when message is empty
This commit is contained in:
Joas Schilling 2023-11-13 17:30:44 +01:00 committed by GitHub
commit 2bc499c04f
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']);