Log Api Soap request

55 views
Skip to first unread message

vj

unread,
May 9, 2018, 4:43:14 PM5/9/18
to AdWords API and Google Ads API Forum
I am downloading adwords api report using php adwords library.

I wants to keep soap api request log in file.

I am trying bellow code.

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Formatter\LineFormatter;

$log = new Logger('channel_name');
$stream = new StreamHandler(__DIR__.'/myRequest.log', Logger::INFO);
$stream->setFormatter(new LineFormatter(null, null, false, true));
$log->pushHandler($stream);

$session = (new AdWordsSessionBuilder())
        ->withDeveloperToken(DEVELOPERTOKEN)
        ->withOAuth2Credential($oAuth2Credential)
        ->withClientCustomerId($client_id)
        ->withSoapSettings($SoapSettingsBuilder)
        ->withReportSettings($reportSettings)
        ->withSoapLogger(new Logger('channel_name'))
        ->build();

but its not creating any log files or request.

Could you please help to log my all soap request using php lib??

If you provide me any example to log request than it would be great.

Thanks.

Luis Xander Talag (AdWords API Team)

unread,
May 9, 2018, 11:17:55 PM5/9/18
to AdWords API and Google Ads API Forum
Hi VJ,

To check where your current log file is located, you may look into your adsapi_php.ini file and see the value of soapLogFilePath (this is the path where your logs is located). You may then change the path based on your preference. You may also check this guide for more details on logging in PHP client library.

Thanks and regards,
Luis
AdWords API Team
Reply all
Reply to author
Forward
0 new messages