diff --git a/application/modules/default/controllers/ErrorController.php b/application/modules/default/controllers/ErrorController.php index 58e49ddf3..6f6a42b36 100644 --- a/application/modules/default/controllers/ErrorController.php +++ b/application/modules/default/controllers/ErrorController.php @@ -49,31 +49,21 @@ class ErrorController extends Zend_Controller_Action $user = new Scores_Utilisateur(); - //Envoyer les erreurs par mail - if (APPLICATION_ENV != 'development') { - $message = ''; - $message.= 'Erreur Applicative : '; - $message.= "\n"; - $message.= 'Message : '.$errors->exception->getMessage(); - $message.= "\n"; - $message.= 'Utilisateur : '.$user->getLogin(); - $message.= "\n"; - $message.= "File :".$errors->exception->getFile().", Ligne : ".$errors->exception->getLine(); - $message.= "\n"; - $message.= "Detail :\n".$errors->exception->getTraceAsString(); - $message.= "\n\n"; - $message.= "Request Parameters :\n ".print_r($this->getRequest()->getParams(), true)."\n"; + $message = ''; + $message.= 'Erreur Applicative : '; + $message.= "\n"; + $message.= 'Message : '.$errors->exception->getMessage(); + $message.= "\n"; + $message.= 'Utilisateur : '.$user->getLogin(); + $message.= "\n"; + $message.= "File :".$errors->exception->getFile().", Ligne : ".$errors->exception->getLine(); + $message.= "\n"; + $message.= "Detail :\n".$errors->exception->getTraceAsString(); + $message.= "\n\n"; + $message.= "Request Parameters :\n ".print_r($this->getRequest()->getParams(), true)."\n"; + $message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n"; + $this->logger->error($message); - $message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n"; - - $c = Zend_Registry::get('config'); - $mail = new Scores_Mail_Method(); - $mail->setSubject('[ERREUR APPLICATIVE] - '.$c->profil->server->name.' -'.date('Ymd')); - $mail->setBodyText($message); - $mail->setFromKey('support'); - $mail->addToKey('supportdev'); - $mail->execute(); - } // Log exception, if logger available if ($log = $this->getLog()) { $log->crit($this->view->message, $errors->exception); diff --git a/library/Scores/Ws/Client.php b/library/Scores/Ws/Client.php index 9af554e27..68d4e77bd 100644 --- a/library/Scores/Ws/Client.php +++ b/library/Scores/Ws/Client.php @@ -209,32 +209,22 @@ class Scores_Ws_Client extends Zend_Soap_Client // --- Logging if ( array_key_exists('log', $methodConfig) ) { - // --- Envoi email de contexte - if( $methodConfig['log'] == 'mail' && in_array(APPLICATION_ENV, array('production', 'staging')) ) { - $message = ''; - $message.= 'Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring; - $message.= ' - Utilisateur : '.$this->getHttpLogin(); + $message = ''; + $message.= 'Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring; + $message.= ' - Utilisateur : '.$this->getHttpLogin(); + $message.= "\n\n"; + $message.= "Method : ".$name.", File :".$fault->getFile().", Ligne : ".$fault->getLine(); + $message.= "\n\n"; + $message.= "Detail :\n".$fault->getTraceAsString(); + $message.= "\n\n"; + if ( $controller = Zend_Controller_Front::getInstance() ) { + $message.= "Request Parameters :\n ".print_r($controller->getRequest()->getParams(), true); $message.= "\n\n"; - $message.= "Method : ".$name.", File :".$fault->getFile().", Ligne : ".$fault->getLine(); - $message.= "\n\n"; - $message.= "Detail :\n".$fault->getTraceAsString(); - $message.= "\n\n"; - if ( $controller = Zend_Controller_Front::getInstance() ) { - $message.= "Request Parameters :\n ".print_r($controller->getRequest()->getParams(), true); - $message.= "\n\n"; - } - $message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n\n"; - $message.= "Requete :\n ".$requete."\n"; - $message.= "Reponse :\n ".$reponse."\n"; - - $c = Zend_Registry::get('config'); - $mail = new Scores_Mail_Method(); - $mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd')); - $mail->setBodyTextC($message); - $mail->setFromKey('contact'); - $mail->addToKey('supportdev'); - $mail->execute(); } + $message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n\n"; + $message.= "Requete :\n ".$name."\n Arguments : ".$arguments."\n"; + $message.= "Reponse :\n ".$response."\n"; + $this->logger->error($message); } return false; diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index 6de798503..1617a21b5 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -750,7 +750,7 @@ class WsScores $params = new stdClass(); $params->id = $id; $params->type = $type; - $params->groupe = $groupes; + $params->groupe = $groupe; $client = $this->loadClient('saisie'); try { $reponse = $client->getLienDoc($params); @@ -3358,13 +3358,7 @@ class WsScores if (APPLICATION_ENV == 'development' ) { $this->logger->info('Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring); } else { - $c = Zend_Registry::get('config'); - $mail = new Scores_Mail_Method(); - $mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd')); - $mail->setBodyTextC($message); - $mail->setFromKey('support'); - $mail->addToKey('supportdev'); - $mail->execute(); + $this->logger->error($message); } } }