Posts tagged with logging

I am using google ads api and displaying Google adwords ads on our site. At every request the terminal displaying logging request and response. I want to know that is there any way to disable request/response Info from console. I am using google ads java library. I tried to use new RequestLogger But I could not disable that. Below is the given message type which I am getting at every google ads api call.

com.google.api.client.http.HttpTransport [] - -------------- REQUEST  -------------- POST https://oauth.googleapis.com/token Accept-Encoding: gzip User-Agent: Google-HTTP-Java-Client/1.39.0 (gzip) Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Length: 241 com.google.api.client.http.HttpTransport [] - curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'User-Agent: Google-HTTP-Java-Client/1.39.0 (gzip)' -H 'Content-Typ e: application/x-www-form-urlencoded; charset=UTF-8' -d '@-' -- 'https://oauth2.googleapis.com/token' << $$$ com.google.api.client.http.HttpTransport [] - Total: 241 bytes com.google.api.client.http.HttpTransport [] - client_id=xxxx&refresh_token=xxxx&grant_type=refresh_token com.google.api.client.http.HttpTransport [] - -------------- RESPONSE -------------- HTTP/1.1 200 OK Transfer-Encoding: chunked Alt-Svc: h3=":443"; ma=2592000,h3-29=":111"; ma=333,h3-T051=":3"; ma=000,h3-Q050=":443"; ma=2000,h3-Q046=":443"; ma=2592000,h3-Q043=":443" 46,43" Server: scaffolding on HTTPServer2 X-Content-Type-Options: nosniff Pragma: no-cache 

We've followed the advice given here: https://developers.google.com/google-ads/api/docs/client-libs/java/logging

Neither of the proposed solutions have any visible effect on what is logged to the console, either in dev or in deployment.

Specifically:

  • added to pom.xml:

      <dependency>       <groupId>org.slf4j</groupId>       <artifactId>slf4j-log4j12</artifactId>       <version>1.7.25</version>   </dependency> 
  • added -Dlog4j.configuration=googleads-logging/log4j.properties to the launch command

no effect.

  • added to pom.xml:

      <dependency>       <groupId>org.slf4j</groupId>       <artifactId>slf4j-jdk14</artifactId>       <version>1.7.25</version>   </dependency> 
  • created jdk-logger.properties in various places, from example found here

  • added -Djava.util.logging.config.file= to the launch command

no effect whatsoever.

We are desperately trying to sort out this issue before Google sunsets the googleads v2 API on October 21. It would be really nice to see exactly what is happening, but so far all we've managed to determine is the endpoint server: googleads.googleapis.com:443

Any advice highly appreciated!