Skip to content

Commit

Permalink
log stacktrace to error log
Browse files Browse the repository at this point in the history
Ultimately the one responsible for fixing the problem will need this
anyway. Better log it right away for (hopefully) better bug reports
  • Loading branch information
splitbrain committed Aug 12, 2020
1 parent 7e0b27f commit 0e69c9a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion inc/ErrorHandler.php
Expand Up @@ -94,7 +94,13 @@ public static function logException($e)
{
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);
}

Expand Down

0 comments on commit 0e69c9a

Please sign in to comment.