?
avatar osignell
osignell
5 Apr 2016

Steps to reproduce the issue

1) enable error logging in PHP with log_errors=on in php.ini
2) create a fatal error in a component, for example a spelling mistake
3) open a page that loads the component

Expected result

Fatal error logged to the server's error log.

Actual result

No message in the server log, brief error displayed in browser only.

System information (as much as possible)

Joomla 3.5.0, PHP 7.0

Additional comments

I think the changes introduced by #9270 have caused this. I have temporarily fixed this locally by adding the following to doErrorHandling() in plugins/system/redirect/redirect.php:

if (ini_get('log_errors'))
error_log('PHP Fatal error: '.$error->getMessage().' in '.$error->getFile().' on line '.$error->getLine());

avatar osignell osignell - open - 5 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2016
Labels Added: ?
avatar osignell osignell - change - 5 Apr 2016
Title
Logging PHP errors to file breos because of
Logging PHP errors to file broken in 3.5
avatar osignell osignell - change - 5 Apr 2016
Title
Logging PHP errors to file breos because of
Logging PHP errors to file broken in 3.5
avatar mbabker
mbabker - comment - 5 Apr 2016

It depends on the type of error being thrown. PHP 7 replaced some fatal errors with a new Error object and that and the Exception class now implement a Throwable interface which any exception handler set by set_exception_handler() will catch. See http://php.net/manual/en/class.error.php and the sidebar there which lists all of the new Error objects.

avatar brianteeman brianteeman - change - 13 Apr 2016
Category Plugins
avatar mbabker
mbabker - comment - 8 May 2016

#10341 will try to write to Joomla's log API when the global exception handler is triggered. If you need additional actions in this scenario you'll need to set up a plugin to register an extended global exception handler.

avatar mbabker mbabker - change - 8 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 19:48:26
Closed_By mbabker
avatar mbabker mbabker - close - 8 May 2016

Add a Comment

Login with GitHub to post a comment