summaryrefslogtreecommitdiffstats
path: root/lib/private/log/owncloud.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-06-04 10:26:02 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-06-04 10:26:02 +0200
commit4ab77f90d2645f503f077903020c6bd56415294a (patch)
tree621250352a8da7db1112f08b1bcaf7b4b3676b0e /lib/private/log/owncloud.php
parent9e31118675d425b99eff340ec7517e478ebc9fcf (diff)
parent917f389747dc3b8b3d5b9ff326a2cee21579f58a (diff)
downloadnextcloud-server-4ab77f90d2645f503f077903020c6bd56415294a.tar.gz
nextcloud-server-4ab77f90d2645f503f077903020c6bd56415294a.zip
Merge pull request #8662 from owncloud/f-lock
f-lock
Diffstat (limited to 'lib/private/log/owncloud.php')
-rw-r--r--lib/private/log/owncloud.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php
index 3590bbd436d..08d0b7d5f93 100644
--- a/lib/private/log/owncloud.php
+++ b/lib/private/log/owncloud.php
@@ -28,6 +28,7 @@
class OC_Log_Owncloud {
static protected $logFile;
+ static protected $reqId;
/**
* Init class data
@@ -68,8 +69,20 @@ class OC_Log_Owncloud {
$timezone = new DateTimeZone('UTC');
}
$time = new DateTime(null, $timezone);
- // remove username/passswords from URLs before writing the to the log file
- $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time->format($format));
+ // remove username/passwords from URLs before writing the to the log file
+ $time = $time->format($format);
+ if($minLevel == OC_Log::DEBUG) {
+ if(empty(self::$reqId)) {
+ self::$reqId = uniqid();
+ }
+ $reqId = self::$reqId;
+ $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '--';
+ $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '--';
+ $entry = compact('reqId', 'app', 'message', 'level', 'time', 'method', 'url');
+ }
+ else {
+ $entry = compact('app', 'message', 'level', 'time');
+ }
$entry = json_encode($entry);
$handle = @fopen(self::$logFile, 'a');
@chmod(self::$logFile, 0640);