Commit edf26f92 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1329 Log impersonated user also in syslog.

Released under the Affero GNU General Public License (AGPL) version 3.
parent fa84c23a
...@@ -166,7 +166,13 @@ class Syslog extends Log { ...@@ -166,7 +166,13 @@ class Syslog extends Log {
*/ */
public function BuildLogString($loglevel, $message, $includeUserDevice = true) { public function BuildLogString($loglevel, $message, $includeUserDevice = true) {
$log = $this->GetLogLevelString($loglevel); // Never pad syslog log because syslog log are usually read with a software. $log = $this->GetLogLevelString($loglevel); // Never pad syslog log because syslog log are usually read with a software.
$log .= ' ['. $this->GetUser() .']'; // when the users differ, we need to log both
if ($this->GetUser() != $this->GetAuthUser()) {
$log .= ' ['. $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() .']';
}
else {
$log .= ' ['. $this->GetUser() .']';
}
if ($loglevel >= LOGLEVEL_DEVICEID) { if ($loglevel >= LOGLEVEL_DEVICEID) {
$log .= '['. $this->GetDevid() .']'; $log .= '['. $this->GetDevid() .']';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment