Commit a66f8222 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-765 Fixed missing spaces in log string. Fixed LOGLEVEL_DEVICEID so it

works as expected. Fixed access of Log->unauthMessageCache - is now an
instance variable. Fixed indentation. Throw a
FatalNotImplementedException instead of a simple Exception.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 701c5142
......@@ -163,7 +163,7 @@ class ZLog {
global $specialLogUsers; // This variable comes from the configuration file (config.php)
$logger = LOGBACKEND;
if (!class_exists($logger)) {
throw new \Exception('The class `'.$logger.'` does not exist.');
throw new FatalNotImplementedException('The logging class `'.$logger.'` does not exist.');
}
list($user) = Utils::SplitDomainUser(strtolower(Request::GetGETUser()));
......
......@@ -80,9 +80,9 @@ class FileLog extends Log {
* @return string
*/
public function BuildLogString($loglevel, $message) {
$log = Utils::GetFormattedTime() . $this->GetPidstr() . $this->GetLogLevelString($loglevel, $loglevel >= LOGLEVEL_INFO) . ' ' . $this->GetUser();
if ($loglevel >= LOGLEVEL_DEVICEID) {
$log .= $this->GetDevid();
$log = Utils::GetFormattedTime() . ' ' . $this->GetPidstr() . ' ' . $this->GetLogLevelString($loglevel, $loglevel >= LOGLEVEL_INFO) . ' ' . $this->GetUser();
if (LOGLEVEL >= LOGLEVEL_DEVICEID || (LOGUSERLEVEL >= LOGLEVEL_DEVICEID && $this->IsAuthUserInSpecialLogUsers())) {
$log .= ' ' . $this->GetDevid();
}
$log .= ' ' . $message;
return $log;
......
......@@ -233,7 +233,7 @@ abstract class Log {
foreach ($this->unauthMessageCache as $authcache) {
$this->WriteForUser($authcache[0], $authcache[1]);
}
self::$unAuthCache = array();
$this->unauthMessageCache = array();
}
$this->WriteForUser($loglevel, $message);
}
......
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