How to add logs to different file for different services - Google Ads API Beta

19 views
Skip to first unread message

cv

unread,
Jan 28, 2020, 4:02:03 AM1/28/20
to AdWords API and Google Ads API Forum
Hi,

How I can maintain different log paths for different services or different modules?

Currently, it is storing logs at the central level, I would like have different logs according to different needs.

Like for Bid Related changes I would say bid_log.log
For Search Query it would say serach_log.log



Thanks,

Google Ads API Forum Advisor Prod

unread,
Jan 29, 2020, 4:52:45 PM1/29/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out. What client library are you using?

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5001USx2QL:ref

cv

unread,
Jan 29, 2020, 11:14:51 PM1/29/20
to AdWords API and Google Ads API Forum
Hi,

I am using Google-ads-php beta library.

Google Ads API Forum Advisor Prod

unread,
Jan 30, 2020, 2:08:51 PM1/30/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

The PHP library conforms to PSR-3 for logging. You can change the configuration to point to a different path as explained here to save to different locations.

Chirag eReportz

unread,
Mar 31, 2020, 9:23:48 AM3/31/20
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Hi Mitchell,

Thank you for the clarification. 


Sorry for the late reply.

But when I tried to create Log like this
I am only getting log as a one liner and not the log that detailed provided by default logger.
$adsLoggerFactory = new LoggerFactory();
$logger = $adsLoggerFactory->createLogger('pausePlacement', $logPath, Logger::DEBUG);

Google Ads API Forum Advisor Prod

unread,
Mar 31, 2020, 2:17:46 PM3/31/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi Chirag,

Can you please share the contents of your google_ads_php.ini file via Reply privately to author? If you are trying to specify your own logger, you can follow the instructions here.
Reply all
Reply to author
Forward
0 new messages