mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Add optional to add backtrace to log items
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
a84fa17c73
commit
61167e3149
1 changed files with 6 additions and 0 deletions
|
|
@ -221,6 +221,12 @@ class Log implements ILogger, IDataLogger {
|
|||
$this->eventDispatcher->dispatchTyped(new BeforeMessageLoggedEvent($app, $level, $entry));
|
||||
}
|
||||
|
||||
$hasBacktrace = isset($entry['exception']);
|
||||
$logBacktrace = $this->config->getValue('log.backtrace', false);
|
||||
if (!$hasBacktrace && $logBacktrace) {
|
||||
$entry['backtrace'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||
}
|
||||
|
||||
try {
|
||||
if ($level >= $minLevel) {
|
||||
$this->writeLog($app, $entry, $level);
|
||||
|
|
|
|||
Loading…
Reference in a new issue