]> source.dussan.org Git - nextcloud-server.git/commitdiff
Port log level filtering from OC_Log_Owncloud to OC_Log_Syslog.
authorAndreas Fischer <bantu@owncloud.com>
Sun, 4 Aug 2013 00:48:00 +0000 (02:48 +0200)
committerAndreas Fischer <bantu@owncloud.com>
Sun, 4 Aug 2013 00:48:00 +0000 (02:48 +0200)
lib/log/syslog.php

index d1fb28d8b0a7f7e1a36c5ac2601f49eaf2845dbb..a28255ed10e339b64df8f61c4f7dd2093693508f 100644 (file)
@@ -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);
+               }
        }
 }