Skip to content

Commit

Permalink
Merge pull request #34475 from owncloud/stable10-log-previous-exceptions
Browse files Browse the repository at this point in the history
[stable10] log wrapped exceptions
  • Loading branch information
Vincent Petry authored Feb 13, 2019
2 parents 3f1c2c3 + a4e19d6 commit e873da8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/private/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,5 +439,10 @@ public function logException($exception, array $context = []) {
$msg = isset($context['message']) ? $context['message'] : 'Exception';
$msg .= ': ' . \json_encode($exception);
$this->log($level, $msg, $context);
// also log previous exception
if ($context['exception']->getPrevious()) {
$context['message'] = 'Caused by';
$this->logException($context['exception']->getPrevious(), $context);
}
}
}

0 comments on commit e873da8

Please sign in to comment.