[英]Google Appengine backend logging on local dev server
How do you get logging out of an appengine backend during local development? 在本地开发过程中,如何从Appengine后端注销? I tried logging, logservice.flush().
我尝试记录logservice.flush()。 No luck.
没运气。
Logging works, but the default logging level is WARNING
, so logging.info() or logging.debug() won't show up. 日志记录有效,但是默认的日志记录级别为
WARNING
,因此不会显示logging.info()或logging.debug()。
You can set the logging level when starting your dev server: 您可以在启动开发服务器时设置日志记录级别:
dev_appserver.py --log_level=debug ...
From dev_appserver.py command-line arguments : 从dev_appserver.py命令行参数中 :
--log_level=...
--log_level = ...
The lowest logging level at which logging messages will be written to the console;
将日志记录消息写入控制台的最低日志记录级别; messages of the specified logging level or higher will be output.
将输出指定日志级别或更高级别的消息。 Possible values are debug, info, warning, error, and critical.
可能的值为调试,信息,警告,错误和严重。
You can also persist your logs to a file : 您还可以将日志保存到文件中 :
By default, logs are stored in memory only in the development server and are accessible if you wish to test the Logs API feature.
默认情况下,日志仅存储在开发服务器的内存中,如果您想测试Logs API功能,则可以访问日志。 If you wish to persist logs from the development server to disk at the default location /tmp/dev_appserver.logs, supply the --persist_logs command line option as follows:
如果希望将日志从开发服务器持久保存到默认位置/tmp/dev_appserver.logs的磁盘,请提供--persist_logs命令行选项,如下所示:
dev_appserver.py --persist_logs your-app-directory
If you wish to persist the logs from the development server to disk at a location of your own choosing, supply the desired path and filename to the --logs_path command line option as follows:
如果希望将日志从开发服务器持久保存到磁盘上您自己选择的位置,请按如下所示为--logs_path命令行选项提供所需的路径和文件名:
dev_appserver.py --logs_path=your-path/your-logfile-name your-app-directory
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.