summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-08-04 15:16:32 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-08-04 15:16:32 -0700
commitb5f18111f4897cfb4c9dfb517bc6b80ce2b6a8ac (patch)
treee017f87e3d592d996d12fe10bb3f66a1795255cc
parent0ae2bb77ba09b319347dcf2ec29a641931185a93 (diff)
parentb716d035c32f5b04bfc398598ddf687a19a21c7d (diff)
downloadnextcloud-server-b5f18111f4897cfb4c9dfb517bc6b80ce2b6a8ac.tar.gz
nextcloud-server-b5f18111f4897cfb4c9dfb517bc6b80ce2b6a8ac.zip
Merge pull request #4308 from owncloud/fix-4194
Port log level filtering from OC_Log_Owncloud to OC_Log_Syslog.
-rw-r--r--lib/log/syslog.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/log/syslog.php b/lib/log/syslog.php
index d1fb28d8b0a..c98deab7109 100644
--- a/lib/log/syslog.php
+++ b/lib/log/syslog.php
@@ -28,10 +28,13 @@ class OC_Log_Syslog {
* write a message in the log
* @param string $app
* @param string $message
- * @param int level
+ * @param int $level
*/
public static function write($app, $message, $level) {
- $syslog_level = self::$levels[$level];
- syslog($syslog_level, '{'.$app.'} '.$message);
+ $minLevel = min(OC_Config::getValue("loglevel", OC_Log::WARN), OC_Log::ERROR);
+ if ($level >= $minLevel) {
+ $syslog_level = self::$levels[$level];
+ syslog($syslog_level, '{'.$app.'} '.$message);
+ }
}
}