-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create custom logger and save to /var/log/pagseguro.log #3
Conversation
@@ -336,9 +338,9 @@ public function callApi($params, $payment, $type='transactions') | |||
$params = $paramsObj->getParams(); | |||
$paramsString = $this->convertToCURLString($params); | |||
|
|||
//$this->writeLog('Parameters being sent to API (/'.$type.'): '. var_export($params, true)); | |||
$this->writeLog('Parameters being sent to API (/'.$type.'): '. var_export($params, true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm almost sure that you don't need the var_export, and $params can be passed as the second argument of writeLog method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@r-martins there's only 1 parameter in writeLog function. var_export is needed since $param was concatenated into a string, Otherwise the log will look like this:
[2018-11-13 08:02:38] main.DEBUG: Parameters being sent to API (/transactions): [] []
@@ -360,7 +362,7 @@ public function callApi($params, $payment, $type='transactions') | |||
} | |||
curl_close($ch); | |||
|
|||
// $this->writeLog('Retorno PagSeguro (/'.$type.'): ' . var_export($response, true)); | |||
$this->writeLog('Retorno PagSeguro (/'.$type.'): ' . var_export($response, true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
break; | ||
case 'Forbidden': | ||
//$this->writeLog('Unauthorized access to Api Pagseguro. Make sure you have permission to use this service. Return: ' . var_export($response, true) | ||
// ); | ||
$this->writeLog('Unauthorized access to Api Pagseguro. Make sure you have permission to use this service. Return: ' . var_export($response, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just make sure we need the var_export..
No description provided.