Child pages
  • [system log] Fatal errors are not stored in log [5.2.1]
Skip to end of metadata
Go to start of metadata

System log is designed to log all errors, that happen during script execution. Unfortunately fatal errors, that are not displayed to end user are never logged.

This happens due exit; statement after fatal error message is displayed in the kHandlerStack::_displayFatalError method:

logger.php
protected function _displayFatalError($errno)
{
   $errno = $this->_getFatalErrorTitle($errno);

   $margin = $this->Application->isAdmin ? '8px' : 'auto';
   echo '<div style="background-color: #FEFFBF; margin: ' . $margin . '; padding: 10px; border: 2px solid red; text-align: center">' . $this->_logger->toString($errno) . '</div>';
   exit;
}

I think that we should take approach from [debugger] Debugger blocks fatal error/exception tracking by System Log [5.2.1] and only exit if we're not already in register_shutdown_function callback. The fix for [system log] Special template for fatal errors and uncatched exceptions [5.3.0-B1] should add that applicationShutdown flag I'm talking about here.

Related Tasks