summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Szabo <roger.szabo@web.de>2017-03-10 16:50:15 +0800
committerRoger Szabo <roger.szabo@web.de>2017-03-10 16:50:15 +0800
commit06a8ac6ff694301c8bc51169f6b86d16a7f5ea4e (patch)
tree1c7f5b11c1220f9a9c1d7939e8d26e9f8bfbc7d9
parent06bcb220b54dc289ed0776f625dab674b69bc618 (diff)
downloadnextcloud-server-06a8ac6ff694301c8bc51169f6b86d16a7f5ea4e.tar.gz
nextcloud-server-06a8ac6ff694301c8bc51169f6b86d16a7f5ea4e.zip
log user agent globally instead
Signed-off-by: Roger Szabo <roger.szabo@web.de>
-rw-r--r--apps/admin_audit/lib/actions/action.php4
-rw-r--r--lib/private/Log/File.php2
2 files changed, 2 insertions, 4 deletions
diff --git a/apps/admin_audit/lib/actions/action.php b/apps/admin_audit/lib/actions/action.php
index e83c33a68ca..2d036675869 100644
--- a/apps/admin_audit/lib/actions/action.php
+++ b/apps/admin_audit/lib/actions/action.php
@@ -74,10 +74,6 @@ class Action {
}
$replaceArray[] = $params[$element];
}
-
- //log the User-Agent
- $text = $text.' with User-Agent: "%s"';
- $replaceArray[] = $_SERVER['HTTP_USER_AGENT'];
$this->logger->info(
vsprintf(
diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php
index be8b72b3a3f..b1acd0175c5 100644
--- a/lib/private/Log/File.php
+++ b/lib/private/Log/File.php
@@ -101,6 +101,7 @@ class File {
} else {
$user = '--';
}
+ $userAgent = ($request->getHeader('User-Agent') !== '') ? $request->getHeader('User-Agent') : '--';
$version = $config->getValue('version', '');
$entry = compact(
'reqId',
@@ -112,6 +113,7 @@ class File {
'method',
'url',
'user',
+ 'userAgent',
'version'
);
$entry = json_encode($entry);