From e03d9e3aa07300aaee5ccad0d8e2b5352d107aee Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Aug 2013 02:48:00 +0200 Subject: 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); + } } } -- cgit v1.2.3