Logging Google App Engine application

2020-02-25 07:56发布

I have made my GAE application using the development server, but now when I deploy it to GAE cloud, some features don't work (some elements are missing), but no exceptions are thrown.

Now I'd like to have some logging to my code so I could find out why these things are working in development environment, but not in GAE cloud, but I haven't found a way to log events like I can do with the development server in Eclipse.

So is it possible to log events like you can do in the Eclipse development server?

4条回答
做自己的国王
2楼-- · 2020-02-25 08:11

You will have to configure logging via java.util.logging.Logger and a logging.properties file in your classpath, preferably in your WEB-INF/classes/ directory. e.g. if you want all your logging to be at the INFO level, the contents of this file should be:

# Set the default logging level for all loggers to INFO
.level = INFO
查看更多
劳资没心,怎么记你
3楼-- · 2020-02-25 08:13

Google App Engine applications written in Java can write information to the log files using java.util.logging.Logger. Log data for an application can be viewed and analyzed using the Administration Console, or downloaded using appcfg.sh request_logs.

More info in the Logging documentation.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2020-02-25 08:17

I assume you are asking for the Log console to see the error info and such. if yes then open your Google app engine launcher and click on your app and you can see a Logs button on the top next to Run and Stop. Good luck!

查看更多
Animai°情兽
5楼-- · 2020-02-25 08:34

The article that was marked as correct answer is a little bit outdated.

Today if you have to read your logs or want remotely debug your app you can use

Java GAE applications still write information to the log files using java.util.logging.Logger.

Again, if you want more information about the Google App Engine Java logging read the documentation.

查看更多
登录 后发表回答