forked from LiveCarta/PayPal-PHP-SDK
Updates to LIPP & Future Payments
- Updated LIPP Sample code - Updated Future Payments to have helper functions for retrieving access token - Updated Logging Syntax to include timestamp and response json
This commit is contained in:
@@ -70,6 +70,11 @@ class PPLoggingManager
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// To suppress the warning during the date() invocation in logs, we would default the timezone to GMT.
|
||||
if (!ini_get('date.timezone')) {
|
||||
date_default_timezone_set('GMT');
|
||||
}
|
||||
|
||||
$config = PPConfigManager::getInstance()->getConfigHashmap();
|
||||
|
||||
$this->isLoggingEnabled = (array_key_exists('log.LogEnabled', $config) && $config['log.LogEnabled'] == '1');
|
||||
@@ -93,7 +98,7 @@ class PPLoggingManager
|
||||
private function log($message, $level = PPLoggingLevel::INFO)
|
||||
{
|
||||
if ($this->isLoggingEnabled && ($level <= $this->loggingLevel)) {
|
||||
error_log($this->loggerName . ": $message\n", 3, $this->loggerFile);
|
||||
error_log("[" . date('d-m-Y h:i:s') . "] " . $this->loggerName . ": $message\n", 3, $this->loggerFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user