User tests: Successful: Unsuccessful:
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.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-03-29 20:04:23 |
Note: see issue http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32785 and pull request #2580