I deployed an Java application on GAE and now I'm finding the way to view application log on GAE.
我在GAE上部署了一个Java应用程序,现在我找到了在GAE上查看应用程序日志的方法。
I read this guide: Reading and Writing Application Logs
我阅读了本指南:阅读和编写应用程序日志
but it doesn't work. I want to view my application log on Stackdriver Logging on Google Cloud Platform screen like below:
但它不起作用。我想在Google Cloud Platform屏幕上查看我的应用程序登录Stackdriver Logging,如下所示:
Does anyone configure to show application log on GAE. Could you suggest me a solution ?
是否有人配置为在GAE上显示应用程序日志。你能给我一个解决方案吗?
My configuration:
- appengine-web.xml
src\main\webapp\WEB-INF\appengine-web.xml
- logging.properties
- Write log code using: I'm using
private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(CategoryResource.class.getName());
使用以下方法编写日志代码:我正在使用private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(CategoryResource.class.getName());
1 个解决方案
#1
1
The documentation you listed literally does exactly what you want. It surfaces the logs in the log viewer on your Google Cloud Console. I have confirmed that it still works.
您列出的文档字面上完全符合您的要求。它会在Google云端控制台上的日志查看器中显示日志。我已经确认它仍然有效。
Please read this part carefully and see if you are still not able to find the logs.
请仔细阅读本部分,看看您是否仍然无法找到日志。
If that's still the case, provide us with your full code on how you setup the logging to include all the steps in the documentation. If the steps are followed, it should work.
如果仍然如此,请向我们提供有关如何设置日志记录的完整代码,以包括文档中的所有步骤。如果遵循这些步骤,它应该工作。