log des erreurs soap dans un fichier

This commit is contained in:
Michael RICOIS 2009-12-18 09:23:57 +00:00
parent f9ce6efe1f
commit ad7d1cd9af

View File

@ -36,6 +36,8 @@ function processSoapFault($clientSoap, $fault, $tabInfo, $debug = FALSE){
$message.= 'tabInfo : '.print_r($tabInfo,true).'<br/><br/>';
$message.= '</pre>';
logSoapFault($message);
if($debug == TRUE){
print '<pre>';
print $message;
@ -61,19 +63,17 @@ function messageSoapFault(){
* @param string $message
* @return void
*/
function mailSoapFault($message){
function mailSoapFault($message)
{
$mail = new PHPMailer();
$mail->From = "contact@scores-decisions.com";
$mail->FromName = "Serveur SD-13408";
$mail->Host = "smtp.free.fr";
$mail->Host = "localhost";
$mail->Mailer = "smtp";
$mail->Subject = "Erreur SOAP - (Date :".date("d")."/".date("m")."/".date("Y").")";
$body = $message;
$mail->MsgHTML($body);
$mail->AddAddress(EMAIL_SUPPORTDEV, "Support");
if(!$mail->Send()) {
//logSoapFault($mail->ErrorInfo);
}
}
/**
@ -81,8 +81,10 @@ function mailSoapFault($message){
* @param string $message
* @return void
*/
function logSoapFault($message){
echo $message;
function logSoapFault($message)
{
$fichier = 'errorsoap-'.date('Y').date('m').date('d').date('H').date('i').date('s').'.txt';
file_put_contents(PATH_DATA.'/log/'.$fichier, $message);
}