I need to debug my Google Cloud Endpoint after it is deployed to AppEngine. I am trying to write entries to the log but they never show up in the log viewer on the Google Developers Console. Here is the logging code I created in Android Studio:
import java.util.logging.Logger;
...
public class MyEndpoint {
private static final Logger log = Logger.getLogger(MyEndpoint.class.getName());
...
log.info("message to log");
This code executes in the cloud without error but nothing shows up in the log. What am I doing wrong?
The entry is not showing in the log because the default logging level in app engine is: WARNING. Setting the logging level prior to calling log.info() caused the log entry to show in the console as expected. Here is the revised code with setLevel in context:
import java.util.logging.Logger;
...
public class MyEndpoint {
private static final Logger log =Logger.getLogger(MyEndpoint.class.getName());
...
log.setLevel(Level.INFO);
log.info("message to log");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With