? ? Failure

User tests: Successful: Unsuccessful:

avatar garyamort
garyamort
29 Jan 2014

If one of the loggers for JLog is unable to create a log entry, JLog aborts.

Many components and classes blindly create formattedtext logs and just assume they will work. If the log path is not writable[for example, deployed to Google App Engine] this means Joomla! will die under certain configurations.

Proposal:
This adds a check in the constructor for JLogLoggerFormattedtext which ensures that the file path it is trying to use is writable. If not, it will throw a RuntimeException.

JLog::addLogEntry is modified:
The creation of a new logger is wrapped in try/catch to check for a RuntimeException.

If there is a RuntimeException, then it will change the log type to messagequeue and use a messagequeue log instead[so as to capture any log data]
Additionally, messageQueue will immediately add a new log entry indicating the file log failure.
Note: if there is a RuntimeException AND the log type is messagequeue then JLog will throw the exception since there is no fallback log.

avatar garyamort garyamort - open - 29 Jan 2014
avatar garyamort
garyamort - comment - 29 Jan 2014

Note: #2949 may resolve issues

avatar garyamort garyamort - change - 29 Mar 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-03-29 20:04:23
avatar garyamort garyamort - close - 29 Mar 2014
avatar garyamort garyamort - close - 29 Mar 2014
avatar garyamort garyamort - head_ref_deleted - 29 Mar 2014

Add a Comment

Login with GitHub to post a comment