issue #0001334 : Mail sur erreur

This commit is contained in:
Michael RICOIS 2012-09-06 14:27:23 +00:00
parent 61e457e56b
commit c335f30312

View File

@ -22,6 +22,30 @@ class ErrorController extends Zend_Controller_Action
break;
}
//Envoyer les erreurs par mail
$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";
$configuration = Zend_Registry::get('configuration');
$mail = new Mail();
$mail->setSubject('[ERREUR APPLICATIVE] - '.$configuration->server->name.' -'.date('Ymd'));
$mail->setBodyTexte($message);
$mail->setFrom('supportdev');
$mail->addToKey('supportdev');
$mail->send();
// Log exception, if logger available
if ($log = $this->getLog()) {
$log->crit($this->view->message, $errors->exception);