Correction affichage niveau log dans log fichier
This commit is contained in:
parent
6fc950408d
commit
0a7a0461b7
@ -169,7 +169,8 @@ function sanitize_string($str)
|
||||
fautes de protection m<EFBFBD>moire. Pour r<EFBFBD>soudre, utiliser le loggage fichier,
|
||||
au lieu du loggage syslog (configuration du module).
|
||||
Si SYSLOG_FILE_NO_ERROR d<EFBFBD>fini, on ne g<EFBFBD>re pas erreur ecriture log
|
||||
\remarks On windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_DEBUG=LOG_INFO=6
|
||||
\remarks On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_DEBUG=LOG_INFO=6
|
||||
On Linux LOG_ERR=3, LOG_WARNING=4, LOG_DEBUG=7
|
||||
*/
|
||||
function dolibarr_syslog($message, $level=LOG_INFO)
|
||||
{
|
||||
@ -198,8 +199,7 @@ function dolibarr_syslog($message, $level=LOG_INFO)
|
||||
else $file=fopen(SYSLOG_FILE,"a+");
|
||||
if ($file)
|
||||
{
|
||||
$liblevelarray=array('0'=>'ERROR','1'=>'ERROR','2'=>'ERROR','3'=>'ERROR','4'=>'ERROR',
|
||||
'5'=>'WARN','6'=>'DEBUG','7'=>'DEBUG');
|
||||
$liblevelarray=array(LOG_ERR=>'ERROR',LOG_WARNING=>'WARN',LOG_DEBUG=>'DEBUG');
|
||||
$liblevel=$liblevelarray[$level];
|
||||
if (! $liblevel) $liblevel='UNDEF';
|
||||
fwrite($file,strftime("%Y-%m-%d %H:%M:%S",time())." ".sprintf("%-5s",$liblevel)." ".$message."\n");
|
||||
@ -2444,7 +2444,7 @@ function get_exdir($num,$level=3)
|
||||
*/
|
||||
function create_exdir($dir)
|
||||
{
|
||||
dolibarr_syslog("functions.inc.php::create_exdir: dir=$dir");
|
||||
dolibarr_syslog("functions.inc.php::create_exdir: dir=$dir",LOG_DEBUG);
|
||||
|
||||
if (@is_dir($dir)) return 0;
|
||||
|
||||
@ -2465,7 +2465,7 @@ function create_exdir($dir)
|
||||
{
|
||||
if (! @is_dir($ccdir))
|
||||
{
|
||||
dolibarr_syslog("functions.inc.php::create_exdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.");
|
||||
dolibarr_syslog("functions.inc.php::create_exdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.",LOG_DEBUG);
|
||||
|
||||
umask(0);
|
||||
if (! @mkdir($ccdir, 0755))
|
||||
@ -2476,7 +2476,7 @@ function create_exdir($dir)
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("functions.inc.php::create_exdir: Directory '".$ccdir."' created");
|
||||
dolibarr_syslog("functions.inc.php::create_exdir: Directory '".$ccdir."' created",LOG_DEBUG);
|
||||
$nberr=0; // On remet <20> z<>ro car si on arrive ici, cela veut dire que les <20>checs pr<70>c<EFBFBD>dents peuvent etre ignor<6F>s
|
||||
$nbcreated++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user