Port log level filtering from OC_Log_Owncloud to OC_Log_Syslog.

This commit is contained in:
Andreas Fischer 2013-08-04 02:48:00 +02:00
parent 3534c3b373
commit e03d9e3aa0
1 changed files with 5 additions and 2 deletions

View 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);
}
}
}