Merge pull request #32383 from atm-etienne/fix/130/remove_dol_syslog_throws
Fix/130/remove dol syslog throws
This commit is contained in:
commit
37f3fccc35
1 changed files with 3 additions and 1 deletions
|
|
@ -1658,8 +1658,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||
if (!empty($message)) {
|
||||
// Test log level
|
||||
$logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG');
|
||||
|
||||
if (!array_key_exists($level, $logLevels)) {
|
||||
throw new Exception('Incorrect log level');
|
||||
dol_syslog('Error Bad Log Level '.$level, LOG_ERR);
|
||||
$level = $logLevels[LOG_ERR];
|
||||
}
|
||||
if ($level > $conf->global->SYSLOG_LEVEL) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue