? Pending

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
7 Jan 2017

Partial Pull Request for Issue #13357

Summary of Changes

Logging is not an action that should result in an unhandled error and the user seeing an error page, so catch if a RuntimeException is thrown through the course of calling JLog::add(). This exception may be thrown if JLog::addLogEntry() cannot create the JLogLogger object or an implementation of JLogLogger::addEntry() throws one on a fail state (i.e. the database logger failing to connect to the database or insert the record, or the formatted text logger failing to write to the filesystem).

Testing Instructions

For all cases where logging to a category other than jerror is performed, the exception is just silently ignored. As these are informational log messages only (mainly deprecation notices), there is no need to trigger an error to the UI and notify the user of a failed log statement. For messages categorized as jerror, the catch block will do exactly what JLogLoggerMessagequeue::addEntry() does and call JFactory::getApplication()->enqueueMessage().

This should mean if you make your log directory unwritable, log messages triggered by code in the admin app should not result in the error page being triggered. You might have to programmatically issue a chmod() command before one of these log statements and reset it after to adequately test this until all log statements are wrapped in try/catch.

Documentation Changes Required

N/A

avatar mbabker mbabker - open - 7 Jan 2017
avatar mbabker mbabker - change - 7 Jan 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Jan 2017
Category Administration com_admin com_categories com_config com_content com_contenthistory com_finder com_installer com_joomlaupdate com_languages com_media com_menus com_messages com_modules
avatar wilsonge
wilsonge - comment - 15 Jan 2017

Can you fix conflicts here please?

avatar mbabker mbabker - change - 15 Jan 2017
Labels Added: ?
avatar mbabker
mbabker - comment - 29 Jan 2017

Tests/reviews here please? Logging shouldn't be a blocking operation, this is one step toward that.

avatar wilsonge wilsonge - change - 5 Feb 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-02-05 17:04:17
Closed_By wilsonge
avatar wilsonge wilsonge - close - 5 Feb 2017
avatar wilsonge wilsonge - merge - 5 Feb 2017

Add a Comment

Login with GitHub to post a comment