Fix regression (empty log were output)
This commit is contained in:
parent
801da08c76
commit
d619a641ce
@ -602,9 +602,8 @@ function dol_strtoupper($utf8_string)
|
|||||||
* This function works only if syslog module is enabled.
|
* This function works only if syslog module is enabled.
|
||||||
* This must not use any call to other function calling dol_syslog (avoid infinite loop).
|
* This must not use any call to other function calling dol_syslog (avoid infinite loop).
|
||||||
*
|
*
|
||||||
* @param string $message Line to log.
|
* @param string $message Line to log. ''=Show nothing
|
||||||
* @param int $level Log level
|
* @param int $level Log level
|
||||||
* 0=Show nothing
|
|
||||||
* On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr
|
* On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr
|
||||||
* On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
|
* On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
|
||||||
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
|
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
|
||||||
@ -619,6 +618,8 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
|||||||
// If syslog module enabled
|
// If syslog module enabled
|
||||||
if (empty($conf->syslog->enabled)) return;
|
if (empty($conf->syslog->enabled)) return;
|
||||||
|
|
||||||
|
if (! empty($message))
|
||||||
|
{
|
||||||
// Test log level
|
// Test log level
|
||||||
$logLevels = array(LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG);
|
$logLevels = array(LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG);
|
||||||
if (!in_array($level, $logLevels, true))
|
if (!in_array($level, $logLevels, true))
|
||||||
@ -664,7 +665,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
|||||||
$loghandlerinstance->export($data,$suffixinfilename);
|
$loghandlerinstance->export($data,$suffixinfilename);
|
||||||
}
|
}
|
||||||
unset($data);
|
unset($data);
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($ident))
|
if (! empty($ident))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user