How to enable logging in Dynamic configuration?

134 views
Skip to first unread message

Алексей Рябиков

unread,
Jan 31, 2023, 1:41:01 AM1/31/23
to Google Ads API and AdWords API Forum
Hi! 
I'm using Dynamic configuration instead Configuration file because it works fine for me ( attempt to build $googleAdsClient from file - returns error idk why). 
But I've stuck with enabling logger in this case. Here is my code and its return error "Call to undefined method Google\Ads\GoogleAds\Lib\V12\GoogleAdsClientBuilder::withlogFilePath()"

$oAuth2Credential = (new OAuth2TokenBuilder())
    ->withClientId('****.apps.googleusercontent.com')
    ->withClientSecret('*****')
    ->withRefreshToken('*****')
    ->build();
$googleAdsClient = (new GoogleAdsClientBuilder())
    ->withOAuth2Credential($oAuth2Credential)
    ->withDeveloperToken('****')
    ->withLoginCustomerId('****')

    ->withlogLevel('INFO')
    ->withlogFilePath('/home/bitrix/www/google.log')
    ->build();     


Can you help me pls, what could be wrong?

P.S. It does not return similar error on other fields like "logLevel" or ''proxy' 

Google Ads API Forum Advisor

unread,
Jan 31, 2023, 12:31:50 PM1/31/23
to house...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for reaching out to the Google Ads API Forum.

I understand that you are trying to use Dynamic configuration instead of Configuration file, and you are encountering error while implementing this. However, this is more on PHP client library related since you are trying to build your own implementation to use dynamic configuration. 

That being said, I would recommend you may consult this with the PHP client library owner. You can post an issue on GitHub to ask that question or if they have any other recommendations for your use case.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2iPize:ref

Google Ads API Forum Advisor

unread,
Jan 31, 2023, 12:39:41 PM1/31/23
to house...@gmail.com, adwor...@googlegroups.com

Hi,

Also, you may file the issue using the Issue tracker here.

Regards,

Алексей Рябиков

unread,
Feb 1, 2023, 10:33:29 AM2/1/23
to Google Ads API and AdWords API Forum
Hi! Okay, thnx, I'll check it out
вторник, 31 января 2023 г. в 20:39:41 UTC+3, adsapi:
Reply all
Reply to author
Forward
0 new messages