Improves php logging

This commit is contained in:
Kyle Spier-Swenson
2017-10-31 13:31:22 -07:00
committed by GitHub
parent acb6a25434
commit da7d046f98

View File

@@ -42,7 +42,7 @@ set_error_handler(function($severity, $message, $file, $line) {
set_exception_handler(function($e) {
header('HTTP/1.1 500 Internal Server Error');
echo "Error on line {$e->getLine()}: " . htmlSpecialChars($e->getMessage());
file_put_contents('htwebhookerror.log', "Error on line {$e->getLine()}: " . $e->getMessage(), FILE_APPEND);
file_put_contents('htwebhookerror.log', '['.date(DATE_ATOM).'] '."Error on line {$e->getLine()}: " . $e->getMessage().PHP_EOL, FILE_APPEND);
die();
});
$rawPost = NULL;