summaryrefslogtreecommitdiffstats
path: root/lib/public/util.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-09-24 17:01:31 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-09-24 20:01:30 +0200
commitdb8e7ce8b95c882c876f932296f25ec08883a1d3 (patch)
tree807952698b4a0704172285f989563ac572df2762 /lib/public/util.php
parent846b8268672df2c626616fec5f71e15570005e84 (diff)
downloadnextcloud-server-db8e7ce8b95c882c876f932296f25ec08883a1d3.tar.gz
nextcloud-server-db8e7ce8b95c882c876f932296f25ec08883a1d3.zip
Remove passwords from logged exception stack traces
* fixed #16318 * create logException in ILogger * add unit tests
Diffstat (limited to 'lib/public/util.php')
-rw-r--r--lib/public/util.php11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/public/util.php b/lib/public/util.php
index c32668b14a8..652df5192cf 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -158,17 +158,10 @@ class Util {
* @param \Exception $ex exception to log
* @param int $level log level, defaults to \OCP\Util::FATAL
* @since ....0.0 - parameter $level was added in 7.0.0
+ * @deprecated 8.2.0 use logException of \OCP\ILogger
*/
public static function logException( $app, \Exception $ex, $level = \OCP\Util::FATAL ) {
- $exception = array(
- 'Exception' => get_class($ex),
- 'Message' => $ex->getMessage(),
- 'Code' => $ex->getCode(),
- 'Trace' => $ex->getTraceAsString(),
- 'File' => $ex->getFile(),
- 'Line' => $ex->getLine(),
- );
- \OCP\Util::writeLog($app, 'Exception: ' . json_encode($exception), $level);
+ \OC::$server->getLogger()->logException($ex, ['app' => $app]);
}
/**