简体   繁体   English

在本地开发服务器上的Google Appengine后端日志记录

[英]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.

相关问题 AppEngine本地开发服务器上的Braintree SDK SSLCertificateError - Braintree SDK SSLCertificateError on AppEngine local dev server AppEngine功能可在本地开发服务器上使用,但不能在实时Web服务器上使用 - AppEngine feature working in local dev server but not on live web server 有没有办法对本地appengine开发服务器强制执行30秒限制? - is there any way to enforce the 30 seconds limit on local appengine dev server? App Engine开发服务器:错误的运行时进程端口['']没有名为google.appengine.dist27.threading的模块 - App Engine dev server: bad runtime process port [''] No module named google.appengine.dist27.threading Google AppEngine本地开发ImportError - Google AppEngine local development ImportError Google OAuth和本地开发者 - Google OAuth and local dev Google云端存储客户端无法在本地dev_server上运行 - Google Cloud Storage Client not working on local dev_server 本地开发服务器的Google App Engine没有终端输出? - No terminal output for google app engine for local dev server? 使用CloudSQL的Google AppEngine上的Django:如何连接数据库(错误2002,无法连接到本地MySQL服务器..) - Django on Google AppEngine with CloudSQL: How to connect database (Error 2002, Can't connect to local MySQL server..) Google appengine将本地gif作为电子邮件附件发送 - Google appengine Send local gif as an email attachment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM