1
0

Automated commit message

This commit is contained in:
PayPalServerSDKs
2024-09-09 15:45:00 +00:00
parent f6cd8b4d4f
commit 462eda52e0
496 changed files with 1632 additions and 1674 deletions

View File

@@ -19,25 +19,25 @@ Represents the logging configurations for API calls. Create instance using `Logg
In order to provide custom logger, any implementation of the `Psr\Log\LoggerInterface` can be used so that you can override the `log` behavior and provide its instance directly in the SDK client initialization.
The following example uses `Monolog\Logger` implementation of `Psr\Log\LoggerInterface` for PayPalRESTAPIsClient initialization.
The following example uses `Monolog\Logger` implementation of `Psr\Log\LoggerInterface` for PaypalServerSdkClient initialization.
```php
<?php
use PayPalRESTAPIsLib\PayPalRESTAPIsClientBuilder;
use PayPalRESTAPIsLib\Logging\LoggingConfigurationBuilder;
use PayPalRESTAPIsLib\Logging\RequestLoggingConfigurationBuilder;
use PayPalRESTAPIsLib\Logging\ResponseLoggingConfigurationBuilder;
use PaypalServerSdkLib\PaypalServerSdkClientBuilder;
use PaypalServerSdkLib\Logging\LoggingConfigurationBuilder;
use PaypalServerSdkLib\Logging\RequestLoggingConfigurationBuilder;
use PaypalServerSdkLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// create a log channel
$logger = new Logger('PayPalRESTAPIs');
$logger = new Logger('PaypalServerSdk');
$logger->pushHandler(new StreamHandler(__DIR__ . '/api_data.log'));
// initialize the sdk client using this logger
$client = PayPalRESTAPIsClientBuilder::init()
$client = PaypalServerSdkClientBuilder::init()
->loggingConfiguration(
LoggingConfigurationBuilder::init()
->logger($logger)