Improve record_log() : use noalyss/log and apache log
This commit is contained in:
parent
59ab697bb7
commit
169820ae43
22 changed files with 35 additions and 34 deletions
|
|
@ -33,7 +33,7 @@ try
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ try
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
@ -152,4 +152,4 @@ echo <<<EOF
|
||||||
<code>$html</code>
|
<code>$html</code>
|
||||||
</data>
|
</data>
|
||||||
EOF;
|
EOF;
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ try
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ if ($op=='folder_add') // operation
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$content=_('Erreur paramètre');
|
$content=_('Erreur paramètre');
|
||||||
$status="NOK";
|
$status="NOK";
|
||||||
return;
|
return;
|
||||||
|
|
@ -104,7 +104,7 @@ if ($op=='folder_remove') // operation
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$content=_('Erreur paramètre');
|
$content=_('Erreur paramètre');
|
||||||
$status="NOK";
|
$status="NOK";
|
||||||
}
|
}
|
||||||
|
|
@ -166,7 +166,7 @@ if ($op=='folder_display') // operation
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$content=_('Erreur paramètre');
|
$content=_('Erreur paramètre');
|
||||||
$status="NOK";
|
$status="NOK";
|
||||||
}
|
}
|
||||||
|
|
@ -200,7 +200,7 @@ if (in_array($op, array('modele_drop', 'modele_modify', 'folder_modify', 'folder
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$content=_('Erreur paramètre');
|
$content=_('Erreur paramètre');
|
||||||
$status="NOK";
|
$status="NOK";
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ try
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,4 +60,4 @@ echo <<<EOF
|
||||||
<code>$html</code>
|
<code>$html</code>
|
||||||
</data>
|
</data>
|
||||||
EOF;
|
EOF;
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ try
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,4 +71,4 @@ echo <<<EOF
|
||||||
<code>$html</code>
|
<code>$html</code>
|
||||||
</data>
|
</data>
|
||||||
EOF;
|
EOF;
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ try
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ try
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,4 +52,4 @@ $profile=new Profile_Menu($cn);
|
||||||
$profile->p_id=$p_id;
|
$profile->p_id=$p_id;
|
||||||
$profile->display_module_menu($module,$p_level);
|
$profile->display_module_menu($module,$p_level);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ try {
|
||||||
$gDossier = dossier::id();
|
$gDossier = dossier::id();
|
||||||
|
|
||||||
} catch (Exception $exc) {
|
} catch (Exception $exc) {
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ try
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,4 +48,4 @@ $cn->exec_sql('delete from profile_menu where pm_id = $1 or pm_id_dep=$1',array(
|
||||||
$cn->exec_sql("delete from profile_menu "
|
$cn->exec_sql("delete from profile_menu "
|
||||||
. " where pm_id_dep is not null "
|
. " where pm_id_dep is not null "
|
||||||
. " and pm_id_dep not in (select pm_id from profile_menu)");
|
. " and pm_id_dep not in (select pm_id from profile_menu)");
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ switch ($action)
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$answer['message']=$exc->getMessage();
|
$answer['message']=$exc->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ switch ($action)
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$answer['message']=$exc->getMessage();
|
$answer['message']=$exc->getMessage();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ class Action_Document_Type_MTable extends Manage_Table_SQL
|
||||||
$cn->rollback();
|
$cn->rollback();
|
||||||
|
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ class Document_Export
|
||||||
$zip=new Zip_Extended();
|
$zip=new Zip_Extended();
|
||||||
$res=$zip->open("{$this->store_pdf}/result.zip",ZipArchive::CREATE);
|
$res=$zip->open("{$this->store_pdf}/result.zip",ZipArchive::CREATE);
|
||||||
if ($res !== true) {
|
if ($res !== true) {
|
||||||
error_log("ERR-DE89 cannot create zip file");
|
record_log("ERR-DE89 cannot create zip file");
|
||||||
record_log($this);
|
record_log($this);
|
||||||
throw new Exception ("ERR-DE89 cannot recreate zip");
|
throw new Exception ("ERR-DE89 cannot recreate zip");
|
||||||
}
|
}
|
||||||
|
|
@ -99,7 +99,7 @@ class Document_Export
|
||||||
// addGmpn
|
// addGmpn
|
||||||
$res=$zip->add_file_pattern($this->store_pdf,"/.*pdf/");
|
$res=$zip->add_file_pattern($this->store_pdf,"/.*pdf/");
|
||||||
if ($res == 0) {
|
if ($res == 0) {
|
||||||
error_log("ERR-DE96 aucun fichier trouvé");
|
record_log("ERR-DE96 aucun fichier trouvé");
|
||||||
record_log($this);
|
record_log($this);
|
||||||
throw new Exception ( "ERR-DE96 cannot recreate zip");
|
throw new Exception ( "ERR-DE96 cannot recreate zip");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@ class Lettering
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,8 @@ try {
|
||||||
$to_poste = $http->request("to_poste");
|
$to_poste = $http->request("to_poste");
|
||||||
$p_filter = $http->request("p_filter", "string");
|
$p_filter = $http->request("p_filter", "string");
|
||||||
} catch (Exception $exc) {
|
} catch (Exception $exc) {
|
||||||
error_log("Missing parameters");
|
record_log("Missing parameters");
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ try
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
throw $exc;
|
throw $exc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ try
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
throw $exc;
|
throw $exc;
|
||||||
}
|
}
|
||||||
$l_type = "JRN";
|
$l_type = "JRN";
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ try
|
||||||
}
|
}
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ function echo_error($p_log, $p_line="", $p_message="")
|
||||||
{
|
{
|
||||||
$msg="ERREUR :" . $p_log . " " . $p_line . " " . $p_message;
|
$msg="ERREUR :" . $p_log . " " . $p_line . " " . $p_message;
|
||||||
echo $msg;
|
echo $msg;
|
||||||
syslog(LOG_ERR,$msg);
|
record_log($msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1893,4 +1893,4 @@ function find_idx($array,$key,$value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ if ( isset($_POST['mod_exercice_label_bt'])) {
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo_warning( $exc->getMessage());
|
echo_warning( $exc->getMessage());
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc);
|
||||||
$cn->rollback();
|
$cn->rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,6 +109,7 @@ if (isset($_POST['add_exercice']))
|
||||||
catch (Exception $ex)
|
catch (Exception $ex)
|
||||||
{
|
{
|
||||||
echo_warning($ex->getMessage());
|
echo_warning($ex->getMessage());
|
||||||
|
record_log($exc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ elseif ($action=="send_email") :
|
||||||
$user_password=$exist_request[0]['password'];
|
$user_password=$exist_request[0]['password'];
|
||||||
/* if too many request , there is a bug somewhere , so record an warning */
|
/* if too many request , there is a bug somewhere , so record an warning */
|
||||||
if ( count($exist_request)> 1 ){
|
if ( count($exist_request)> 1 ){
|
||||||
error_log("WRE109 Trop de request pour ".var_export($exist_request,true));
|
record_log("WRE109 Trop de request pour ".var_export($exist_request,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ class Acc_ComputeTest extends TestCase
|
||||||
catch (Exception $exc)
|
catch (Exception $exc)
|
||||||
{
|
{
|
||||||
echo $exc->getMessage();
|
echo $exc->getMessage();
|
||||||
error_log($exc->getTraceAsString());
|
record_log($exc->getTraceAsString());
|
||||||
$this->assertTrue(FALSE);
|
$this->assertTrue(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue