Show additional information in exception log as well
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 16 Oct 2013 22:31:59 +0000 (00:31 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 16 Oct 2013 22:34:17 +0000 (00:34 +0200)
see http://beta.woltlab.com/index.php/Thread/4155-Exception-Log-enth%C3%A4lt-keine-SQL-Informationen/

wcfsetup/install/files/acp/templates/exceptionLogView.tpl
wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php
wcfsetup/install/files/lib/system/exception/LoggedException.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index b11df8b5279177dc9ad7140bfec4eb520cf3c796..d79d8dbcea426c5d3cb361150129d1f68e9410f4 100644 (file)
                                                <dt>{lang}wcf.acp.exceptionLog.exception.userAgent{/lang}</dt>
                                                <dd>{$exception[userAgent]}</dd>
                                        </dl>
+                                       {if $exception[information]}
+                                               <dl>
+                                                       <dt>{lang}wcf.acp.exceptionLog.exception.information{/lang}</dt>
+                                                       <dd>{@$exception[information]}</dd>
+                                               </dl>
+                                       {/if}
                                        <dl>
                                                <dt>{lang}wcf.acp.exceptionLog.exception.stacktrace{/lang}</dt>
                                                <dd style="font-family: monospace; word-wrap: wrap-all; word-break: break-all;">
index d3694c6c50fae863422308e1663be24499ccdac2..514bef7fe6ce97fbca9bccfdef487ef2cdabeb12 100644 (file)
@@ -7,6 +7,7 @@ use wcf\system\exception\IllegalLinkException;
 use wcf\system\Regex;
 use wcf\system\WCF;
 use wcf\util\DirectoryUtil;
+use wcf\util\JSON;
 use wcf\util\StringUtil;
 
 /**
@@ -135,6 +136,7 @@ WCF version: (?P<wcfVersion>.*?)
 Request URI: (?P<requestURI>.*?)
 Referrer: (?P<referrer>.*?)
 User-Agent: (?P<userAgent>.*?)
+Information: (?P<information>.*?)
 Stacktrace: 
 (?P<stacktrace>.*)', Regex::DOT_ALL);
                $stackTraceFormatter = new Regex('^\s+(#\d+)', Regex::MULTILINE);
@@ -152,6 +154,7 @@ Stacktrace:
                        
                        $this->exceptions[$key] = $exceptionRegex->getMatches();
                        $this->exceptions[$key]['stacktrace'] = explode("\n", $stackTraceFormatter->replace(StringUtil::encodeHTML($this->exceptions[$key]['stacktrace']), '<strong>\\1</strong>'));
+                       $this->exceptions[$key]['information'] = JSON::decode($this->exceptions[$key]['information']);
                }
        }
        
index ed61d70682b78fa66a99472bfb17c49fb2de42d8..1b8343db0ac0e91c1d9c7f0117a664e7986f19c9 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\exception;
 use wcf\system\WCF;
+use wcf\util\JSON;
 use wcf\util\StringUtil;
 
 /**
@@ -98,6 +99,7 @@ class LoggedException extends \Exception {
                        'Request URI: '.(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '')."\n".
                        'Referrer: '.(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')."\n".
                        'User-Agent: '.(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '')."\n".
+                       'Information: '.JSON::encode($this->information)."\n".
                        "Stacktrace: \n  ".implode("\n  ", explode("\n", $this->__getTraceAsString()))."\n";
                
                // calculate Exception-ID
index 48ac00461a3bd03bc05fd48b2de1b1c39b9caf8c..661bee00f9db68d345594366b6edb5e064e085a4 100644 (file)
                <item name="wcf.acp.exceptionLog.exception.file"><![CDATA[Datei (Zeile)]]></item>
                <item name="wcf.acp.exceptionLog.exception.requestURI"><![CDATA[Aufgerufene URL]]></item>
                <item name="wcf.acp.exceptionLog.exception.referrer"><![CDATA[Referrer]]></item>
+               <item name="wcf.acp.exceptionLog.exception.information"><![CDATA[Zusatzinformationen]]></item>
                <item name="wcf.acp.exceptionLog.exception.stacktrace"><![CDATA[Stacktrace]]></item>
                <item name="wcf.acp.exceptionLog.exception.copy"><![CDATA[Fehlermeldung kopieren]]></item>
                <item name="wcf.acp.exceptionLog.exceptionNotFound"><![CDATA[Es wurde kein Fehler mit der ID „{$exceptionID}“ gefunden.]]></item>
index 6431b97485f76f092d68898a1b89dbf058c770ab..101caff63224acbc8f6a7e784f662795f94f0283 100644 (file)
@@ -214,6 +214,7 @@ Examples for medium ID detection:
                <item name="wcf.acp.exceptionLog.exception.file"><![CDATA[File (Line)]]></item>
                <item name="wcf.acp.exceptionLog.exception.requestURI"><![CDATA[Requested URL]]></item>
                <item name="wcf.acp.exceptionLog.exception.referrer"><![CDATA[Referrer]]></item>
+               <item name="wcf.acp.exceptionLog.exception.information"><![CDATA[Additional information]]></item>
                <item name="wcf.acp.exceptionLog.exception.stacktrace"><![CDATA[Stacktrace]]></item>
                <item name="wcf.acp.exceptionLog.exception.copy"><![CDATA[Copy error message]]></item>
                <item name="wcf.acp.exceptionLog.exceptionNotFound"><![CDATA[No error with the ID “{$exceptionID}” was found.]]></item>