Skip to content

Commit

Permalink
fix(logging): make clearer exception numbers are timestamps
Browse files Browse the repository at this point in the history
Fixes #9924
  • Loading branch information
mrclay committed Jul 2, 2016
1 parent fbe8ff6 commit 9c70596
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions engine/lib/elgglib.php
Expand Up @@ -796,7 +796,7 @@ function elgg_trigger_plugin_hook($hook, $type, $params = null, $returnvalue = n
*/ */
function _elgg_php_exception_handler($exception) { function _elgg_php_exception_handler($exception) {
$timestamp = time(); $timestamp = time();
error_log("Exception #$timestamp: $exception"); error_log("Exception at time $timestamp: $exception");


// Wipe any existing output buffer // Wipe any existing output buffer
ob_end_clean(); ob_end_clean();
Expand Down Expand Up @@ -852,8 +852,8 @@ function _elgg_php_exception_handler($exception) {
$timestamp = time(); $timestamp = time();
$message = $e->getMessage(); $message = $e->getMessage();
http_response_code(500); http_response_code(500);
echo "Fatal error in exception handler. Check log for Exception #$timestamp"; echo "Fatal error in exception handler. Check log for Exception at time $timestamp";
error_log("Exception #$timestamp : fatal error in exception handler : $message"); error_log("Exception at time $timestamp : fatal error in exception handler : $message");
} }
} }


Expand Down
2 changes: 1 addition & 1 deletion views/failsafe/messages/exceptions/exception.php
Expand Up @@ -15,6 +15,6 @@
<span title="Unrecoverable Error"> <span title="Unrecoverable Error">
<?php echo elgg_echo('exception:contact_admin'); ?> <?php echo elgg_echo('exception:contact_admin'); ?>
<br /><br /> <br /><br />
Exception #<?php echo $vars['ts']; ?>. Exception at time <?php echo $vars['ts']; ?>.
</span> </span>
</p> </p>

0 comments on commit 9c70596

Please sign in to comment.