Skip to content

Commit

Permalink
Log everything option in the System - Debug plugin
Browse files Browse the repository at this point in the history
When enabled the updater log messages are written to logs/everything.php. This allows site administrators to see how long it takes fetching each update site's contents and which update sites cannot be loaded at all. Previously it was impossible to debug update issues as there was absolutely no feedback whatsoever.
  • Loading branch information
Nicholas K. Dionysopoulos committed Dec 4, 2014
1 parent baebb28 commit 52adb04
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.plg_system_debug.ini
Expand Up @@ -25,6 +25,8 @@ PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_INCLUDE="Include"
PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_LABEL="Log Category Mode"
PLG_DEBUG_FIELD_LOG_DEPRECATED_DESC="If enabled, API marked as deprecated will be logged. Only use this setting for short periods of time for refactoring purposes."
PLG_DEBUG_FIELD_LOG_DEPRECATED_LABEL="Log deprecated API"
PLG_DEBUG_FIELD_LOG_EVERYTHING_DESC="If enabled, all log messages produced by Joomla! will be logged except deprecated API and database queries. Only use this setting for short periods of time for site debugging purposes."
PLG_DEBUG_FIELD_LOG_EVERYTHING_LABEL="Log everything"
PLG_DEBUG_FIELD_LOG_PRIORITIES_ALERT="Alert"
PLG_DEBUG_FIELD_LOG_PRIORITIES_ALL="All"
PLG_DEBUG_FIELD_LOG_PRIORITIES_CRITICAL="Critical"
Expand Down
6 changes: 6 additions & 0 deletions plugins/system/debug/debug.php
Expand Up @@ -98,6 +98,12 @@ public function __construct(&$subject, $config)
JLog::addLogger(array('text_file' => 'deprecated.php'), JLog::ALL, array('deprecated'));
}

// Log everything (except deprecated APIs, these are logged separately with the option above).
if ($this->params->get('log-everything'))
{
JLog::addLogger(array('text_file' => 'everything.php'), JLog::ALL, array('deprecated', 'databasequery'), true);
}

// Get the application if not done by JPlugin. This may happen during upgrades from Joomla 2.5.
if (!$this->app)
{
Expand Down
10 changes: 10 additions & 0 deletions plugins/system/debug/debug.xml
Expand Up @@ -177,6 +177,16 @@
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field name="log-everything" type="radio"
class="btn-group btn-group-yesno"
default="0"
description="PLG_DEBUG_FIELD_LOG_EVERYTHING_DESC"
label="PLG_DEBUG_FIELD_LOG_EVERYTHING_LABEL"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
</fields>
</config>
Expand Down

0 comments on commit 52adb04

Please sign in to comment.