googleads / googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP
Apache License 2.0
655 stars 770 forks source link

Enabling of SOAP logs not working #716

Closed StephenRostantiBoonsMedia closed 2 years ago

StephenRostantiBoonsMedia commented 3 years ago

I have tried enabling SOAP logs by following the instructions here:

https://github.com/googleads/googleads-php-lib#logging

I have edited my adsapi_php.ini file to include the filepath. However, it does not generate anything into the logfile when calling the API. I tried both manually creating the blank file and not having any file in the filepath I specified (so as to autocreate it) but to no avail. Could somebody please tell me where I am going wrong?

thangduo commented 3 years ago

Hi,

I can investigate this further. But I need more information first:

  1. Which API are you trying to connect with? Ad Manager API endpoints or Google Ads (aka AdWords) API endpoints?
  2. Which OS are you using?
  3. Can you post the LOGGING section of your adsapi_php.ini file? Please make sure you don't post the entire adsapi_php.ini file because it could expose your credentials.

Thanks, Thang

StephenRostantiBoonsMedia commented 3 years ago

Hello Thang,

Thank you for getting back so quickly. In answer to your questions:

1) AdWords API 2) Ubuntu 20.04 3) [LOGGING] ; Optional logging settings. soapLogFilePath = "/home/stephen/Desktop/Projects/api-project/var/logs/googleLog.log" soapLogLevel = "NOTICE" ; reportDownloaderLogFilePath = "path/to/your/report-downloader.log" ; reportDownloaderLogLevel = "INFO"

I hope this info helps you in finding the issue I am currently having.

Kind regards

Stephen

thangduo commented 3 years ago

Can you please try to change the log level to DEBUG and retry? Also, what service are you calling?

soapLogLevel = "DEBUG"

StephenRostantiBoonsMedia commented 3 years ago

I changed to DEBUG but still it is not working. I am calling AssetService and AdGroupAdService I am trying to create a MultiAssetResponsiveDisplayAd().

fiboknacky commented 3 years ago

Have you checked that your program has a write permission on the directory you specified? Can you just specify a file name and see if there is a log produced?

thangduo commented 3 years ago

I could verify that the logging feature is working on a new Ubuntu VM. So, it's likely a problem with your specific hosting environment. Can you remove the log to file configuration line and observe whether you see log statements in the console?

// Remove this line. soapLogFilePath = "path/to/your/soap.log"

StephenRostantiBoonsMedia commented 3 years ago

@fiboknacky Thank you for also trying to help. The dir has write permissions because there is another log file in there for Symfony logs and that works fine.

@thangduo I removed the log to file configuration like you asked and tried again. I only got this in the console:

Uncaught TypeError: Cannot set property 'className' of null at Object.createTabs (TestCampaign-1808210508:1284) at HTMLDocument. (TestCampaign-1808210508:1284)

thangduo commented 2 years ago

Hi Stephen,

Unfortunately, I am unable to reproduce this issue on a fresh new install of Ubuntu 20.04.3 LTS (Focal Fossa).

Here's what I did for cross-check:

Thanks, Thang