Merge pull request #41406 from nextcloud/bugfix/noid/log-exception-class-when-message-is-empty

fix(log): Log exception class when message is empty
This commit is contained in:
Joas Schilling 2023-11-13 14:28:52 +01:00 committed by GitHub
commit 073ec6d217
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -344,7 +344,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']);