<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
</option>
+ <option name="enable_production_debug_mode">
+ <categoryname>module.development</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ </option>
<option name="enable_benchmark">
<categoryname>module.development</categoryname>
<optiontype>boolean</optiontype>
$statement = $this->handleLimitParameter($statement, $limit, $offset);
try {
- $pdoStatement = $this->pdo->prepare($statement);
+ // Append routing information of the current request as a comment.
+ // This allows the system administrator to find offending requests
+ // in MySQL's slow query log and / or MySQL's process list.
+ // Note: This is meant to be run unconditionally in production to be
+ // useful. Thus the code to retrieve the request information
+ // must be absolutely lightweight.
+ $requestInformation = '';
+ if (ENABLE_PRODUCTION_DEBUG_MODE && isset($_SERVER['REQUEST_URI'])) {
+ $requestInformation = substr($_SERVER['REQUEST_URI'], 0, 90);
+ if (isset($_REQUEST['className']) && isset($_REQUEST['actionName'])) {
+ $requestInformation .= ' ('.$_REQUEST['className'].':'.$_REQUEST['actionName'].')';
+ }
+ $requestInformation = substr($requestInformation, 0, 180);
+ }
+
+ $pdoStatement = $this->pdo->prepare($statement.($requestInformation ? " -- ".$this->pdo->quote($requestInformation) : ''));
return new $this->preparedStatementClassName($this, $pdoStatement, $statement);
}
<item name="wcf.acp.option.show_version_number"><![CDATA[Versionsnummer der Software im Copyright-Hinweis anzeigen]]></item>
<item name="wcf.acp.option.enable_debug_mode"><![CDATA[Debug-Modus aktivieren]]></item>
<item name="wcf.acp.option.enable_debug_mode.description"><![CDATA[Aktiviert ausführliche Fehlerberichte. Diese Option sollte im Live-Betrieb abgeschaltet werden.]]></item>
+ <item name="wcf.acp.option.enable_production_debug_mode"><![CDATA[Problemanalyse im Live-Betrieb]]></item>
+ <item name="wcf.acp.option.enable_production_debug_mode.description"><![CDATA[Hängt die aktuelle URL an Datenbankabfragen an, um diese im Log des Datenbankservers einfacher identifizieren zu können.]]></item>
<item name="wcf.acp.option.external_link_rel_nofollow"><![CDATA[Externe Links mit dem Attribut „rel="nofollow"“ versehen]]></item>
<item name="wcf.acp.option.external_link_rel_nofollow.description"><![CDATA[Das Attribut „rel="nofollow"“ weist Suchmaschinen an, einen bestimmten Link auf einer Seite zu ignorieren.]]></item>
<item name="wcf.acp.option.external_link_target_blank"><![CDATA[Externe Links in neuem Fenster öffnen]]></item>
<item name="wcf.acp.option.show_version_number"><![CDATA[Display version number in copyright notice]]></item>
<item name="wcf.acp.option.enable_debug_mode"><![CDATA[Enable debug mode]]></item>
<item name="wcf.acp.option.enable_debug_mode.description"><![CDATA[Enables extensive error messages, it should always be disabled in production environments!]]></item>
+ <item name="wcf.acp.option.enable_production_debug_mode"><![CDATA[Problem analysis in production environments]]></item>
+ <item name="wcf.acp.option.enable_production_debug_mode.description"><![CDATA[Appends the current URL to database queries to assist looking them up in the database server’s log files.]]></item>
<item name="wcf.acp.option.external_link_rel_nofollow"><![CDATA[Append the attribute “rel="nofollow"” to all external links]]></item>
<item name="wcf.acp.option.external_link_rel_nofollow.description"><![CDATA[The attribute “rel="nofollow"” tells search engines to disregard external links.]]></item>
<item name="wcf.acp.option.external_link_target_blank"><![CDATA[Open external links in a new window]]></item>