Fix: Bad error management
This commit is contained in:
parent
57a869683d
commit
7c826dc38d
@ -116,13 +116,17 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
|
|||||||
if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+');
|
if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+');
|
||||||
else $filefd = fopen($logfile, 'a+');
|
else $filefd = fopen($logfile, 'a+');
|
||||||
|
|
||||||
if (!$filefd && ! defined("SYSLOG_FILE_NO_ERROR"))
|
if (! $filefd)
|
||||||
|
{
|
||||||
|
if (! defined("SYSLOG_FILE_NO_ERROR"))
|
||||||
{
|
{
|
||||||
// Do not break dolibarr usage if log fails
|
// Do not break dolibarr usage if log fails
|
||||||
//throw new Exception('Failed to open log file '.basename($logfile));
|
//throw new Exception('Failed to open log file '.basename($logfile));
|
||||||
print 'Failed to open log file '.basename($logfile);
|
print 'Failed to open log file '.basename($logfile);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$logLevels = array(
|
$logLevels = array(
|
||||||
LOG_EMERG => 'EMERG',
|
LOG_EMERG => 'EMERG',
|
||||||
LOG_ALERT => 'ALERT',
|
LOG_ALERT => 'ALERT',
|
||||||
@ -140,3 +144,4 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
|
|||||||
fclose($filefd);
|
fclose($filefd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user