From 29d0b2cd41b1cc7ddac5a4274c72fb96df16f7dd Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Aug 2013 02:48:00 +0200 Subject: [PATCH] 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 d1fb28d8b0a..a28255ed10e 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); + } } } -- 2.39.5