Depending on the environment, we want to be able to change the 
logFilePath and logLevel.
Both are part of google_ads_php.ini so it would be logical if this can also 
be set via the environment variable.

I have now found a solution:

// Binds the Google Ads API client.
$this->app->singleton('Google\Ads\GoogleAds\Lib\V9\GoogleAdsClient', function 
() {
// Constructs a Google Ads API client configured from the properties file.
return (new GoogleAdsClientBuilder())
->withLogger((new LoggerFactory())
->createLogger('google-ads', config('googleads.log_file_path'), 
config('googleads.log_level')))
->withOAuth2Credential((new OAuth2TokenBuilder())
->fromEnvironmentVariables()
->build())
->fromEnvironmentVariables()
->build();
});

adsapi schrieb am Dienstag, 16. November 2021 um 17:19:51 UTC+1:

> Hi Robert,
>
> There's no documented support to define the logFilePath as environment 
> variable in our PHP client library. Could you state in business terms your 
> use case?
>
> Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 
> 2021 
> Google Ads API and AdWords API Annual Survey 
> <https://google.qualtrics.com/jfe/form/SV_eQbOpf4VxRyyqqO?source=so>
>
> Regards,
>   
> [image: Google Logo] 
> Aryeh Baker 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2R9S88:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7c714dc4-e0a6-4822-a775-6160e3fa732fn%40googlegroups.com.
  • de... Robert Zimmermann
    • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
      • ... Robert Zimmermann
        • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum

Reply via email to