log stacktrace to error log

Ultimately the one responsible for fixing the problem will need this
anyway. Better log it right away for (hopefully) better bug reports
This commit is contained in:
Andreas Gohr 2020-07-13 19:34:59 +02:00
parent 7e0b27f2ad
commit 0e69c9aff9
1 changed files with 7 additions and 1 deletions

View File

@ -94,7 +94,13 @@ EOT;
{
global $conf;
$log = join("\t", [gmdate('c'), get_class($e), $e->getFile() . ':' . $e->getLine(), $e->getMessage()]) . "\n";
$log = join("\t", [
gmdate('c'),
get_class($e),
$e->getFile() . '(' . $e->getLine() . ')',
$e->getMessage(),
]) . "\n";
$log .= $e->getTraceAsString() . "\n";
return io_saveFile($conf['cachedir'] . '/_error.log', $log, true);
}