From d0e267c222b8dd5d29b7f0c0b36da8fcea6fe937 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 17 Oct 2013 00:31:59 +0200 Subject: [PATCH] Show additional information in exception log as well see http://beta.woltlab.com/index.php/Thread/4155-Exception-Log-enth%C3%A4lt-keine-SQL-Informationen/ --- wcfsetup/install/files/acp/templates/exceptionLogView.tpl | 6 ++++++ .../files/lib/acp/page/ExceptionLogViewPage.class.php | 3 +++ .../files/lib/system/exception/LoggedException.class.php | 2 ++ wcfsetup/install/lang/de.xml | 1 + wcfsetup/install/lang/en.xml | 1 + 5 files changed, 13 insertions(+) diff --git a/wcfsetup/install/files/acp/templates/exceptionLogView.tpl b/wcfsetup/install/files/acp/templates/exceptionLogView.tpl index b11df8b527..d79d8dbcea 100644 --- a/wcfsetup/install/files/acp/templates/exceptionLogView.tpl +++ b/wcfsetup/install/files/acp/templates/exceptionLogView.tpl @@ -97,6 +97,12 @@
{lang}wcf.acp.exceptionLog.exception.userAgent{/lang}
{$exception[userAgent]}
+ {if $exception[information]} +
+
{lang}wcf.acp.exceptionLog.exception.information{/lang}
+
{@$exception[information]}
+
+ {/if}
{lang}wcf.acp.exceptionLog.exception.stacktrace{/lang}
diff --git a/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php b/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php index d3694c6c50..514bef7fe6 100644 --- a/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php @@ -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.*?) Request URI: (?P.*?) Referrer: (?P.*?) User-Agent: (?P.*?) +Information: (?P.*?) Stacktrace: (?P.*)', 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']), '\\1')); + $this->exceptions[$key]['information'] = JSON::decode($this->exceptions[$key]['information']); } } diff --git a/wcfsetup/install/files/lib/system/exception/LoggedException.class.php b/wcfsetup/install/files/lib/system/exception/LoggedException.class.php index ed61d70682..1b8343db0a 100644 --- a/wcfsetup/install/files/lib/system/exception/LoggedException.class.php +++ b/wcfsetup/install/files/lib/system/exception/LoggedException.class.php @@ -1,6 +1,7 @@ information)."\n". "Stacktrace: \n ".implode("\n ", explode("\n", $this->__getTraceAsString()))."\n"; // calculate Exception-ID diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 48ac00461a..661bee00f9 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -215,6 +215,7 @@ + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 6431b97485..101caff632 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -214,6 +214,7 @@ Examples for medium ID detection: + -- 2.20.1