Commit 6972016a authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #495 in ZP/z-push from...

Merge pull request #495 in ZP/z-push from bugfix/ZP-1182-logauthfail-doesn-t-log-into-z-push-error.log to develop

* commit '159c6ba7':
  ZP-1182 Check all loglevels bitwise.
  ZP-1182 Also log WARN messages into the error log.
  ZP-1182 Remove logging into the error log as messages for the error log file are also written by afterlog().
parents f29c714e 159c6ba7
...@@ -95,10 +95,6 @@ class FileLog extends Log { ...@@ -95,10 +95,6 @@ class FileLog extends Log {
protected function Write($loglevel, $message) { protected function Write($loglevel, $message) {
$data = $this->buildLogString($loglevel, $message) . PHP_EOL; $data = $this->buildLogString($loglevel, $message) . PHP_EOL;
@file_put_contents(LOGFILE, $data, FILE_APPEND); @file_put_contents(LOGFILE, $data, FILE_APPEND);
if (($loglevel & LOGLEVEL_FATAL) || ($loglevel & LOGLEVEL_ERROR)) {
@file_put_contents(LOGERRORFILE, $data, FILE_APPEND);
}
} }
/** /**
...@@ -122,7 +118,7 @@ class FileLog extends Log { ...@@ -122,7 +118,7 @@ class FileLog extends Log {
* @return void * @return void
*/ */
protected function afterLog($loglevel, $message) { protected function afterLog($loglevel, $message) {
if (($loglevel & LOGLEVEL_FATAL) || ($loglevel & LOGLEVEL_ERROR)) { if ($loglevel & (LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARN)) {
$data = $this->buildLogString($loglevel, $message) . PHP_EOL; $data = $this->buildLogString($loglevel, $message) . PHP_EOL;
@file_put_contents(LOGERRORFILE, $data, FILE_APPEND); @file_put_contents(LOGERRORFILE, $data, FILE_APPEND);
} }
......
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