From e03d9e3aa07300aaee5ccad0d8e2b5352d107aee Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Aug 2013 02:48:00 +0200 Subject: [PATCH 1/2] Port log level filtering from OC_Log_Owncloud to OC_Log_Syslog. --- lib/log/syslog.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/log/syslog.php b/lib/log/syslog.php index d1fb28d8b0..a28255ed10 100644 --- a/lib/log/syslog.php +++ b/lib/log/syslog.php @@ -31,7 +31,10 @@ class OC_Log_Syslog { * @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); + } } } From b716d035c32f5b04bfc398598ddf687a19a21c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 4 Aug 2013 22:58:40 +0200 Subject: [PATCH 2/2] fixing PHPDoc --- lib/log/syslog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/log/syslog.php b/lib/log/syslog.php index a28255ed10..c98deab710 100644 --- a/lib/log/syslog.php +++ b/lib/log/syslog.php @@ -28,7 +28,7 @@ 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) { $minLevel = min(OC_Config::getValue("loglevel", OC_Log::WARN), OC_Log::ERROR);