从AppEngine下载日志,包括Python日志语句 [英] Download Log from AppEngine Including Python Log Statements

查看:85
本文介绍了从AppEngine下载日志,包括Python日志语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道你可以用appcfg.py下载原始访问日志,但是我真的很感兴趣的是有关Python日志语句,异常和API统计信息(就像在线日志查看器)的特定请求的所有信息。有谁知道是否有办法以另一种方式获取这些信息,然后自己构建它?



如果有人想知道,我们想要做一些连续的统计分析解决方案

当然 - 只要通过--severity标志就可以解决问题并将它们显示在办公室的大屏幕上。

to appcfg.py:

  $ appcfg.py help request_logs 
用法:appcfg.py [options] request_logs<目录> < OUTPUT_FILE>

以Apache通用日志格式写入请求日志。

'request_logs'命令将请求日志从应用程序
导出到文件。它会按时间顺序编写订购
的Apache通用日志格式记录。如果输出文件是' - 'stdout将被写入。

选项:
-h,--help显示帮助信息并退出。
-q,--quiet仅打印错误。
-v,--verbose打印信息级别日志。
- 打印所有日志。
-s SERVER,--server = SERVER
要连接的服务器。
--insecure与服务器通信时使用HTTP。
-e EMAIL,--email = EMAIL
要使用的用户名。将提示如果省略。
-H HOST,--host = HOST覆盖所有RPC发送的主机头。
--no_cookies不要将认证cookie保存到本地磁盘。
--passin从标准输入读取登录密码。
-A APP_ID,--application = APP_ID
覆盖app.yaml文件中的应用程序。
-V VERSION,--version = VERSION
从app.yaml文件覆盖(主要)版本。
-n NUM_DAYS,--num_days = NUM​​_DAYS
获取日志数据的天数。截止
点是午夜UTC。使用0获得所有可用的
日志。默认值是1,除非--append也被给出;
则默认值为0.
-a,--append附加到现有文件。
--severity = SEVERITY要获取的应用程序级日志消息的严重性。范围
是0(DEBUG)到4(CRITICAL)。如果省略,则只返回
请求日志。
--vhost = VHOST要获取的日志消息的虚拟主机。如果省略,则返回
所有日志消息。
--include_vhost在日志消息中包含虚拟主机。
--end_date = END_DATE日志数据的结束日期(如YYYY-MM-DD)。
默认为今天。


I know you can download the raw access logs with appcfg.py, but I'm really interested in all the information around a specific request like python logging statements, exceptions and api statistics (just like the online log viewer). Does anyone know if there is a way to get that information another way then having to build it yourself?

If case anyone is wondering, we want to do some continuos statistical analyzing for problems and displaying them on a large screen on a wall in the office.

解决方案

Sure - just pass the --severity flag to appcfg.py:

$ appcfg.py help request_logs
Usage: appcfg.py [options] request_logs <directory> <output_file>

Write request logs in Apache common log format.

The 'request_logs' command exports the request logs from your application
to a file.  It will write Apache common log format records ordered
chronologically.  If output file is '-' stdout will be written.

Options:
  -h, --help            Show the help message and exit.
  -q, --quiet           Print errors only.
  -v, --verbose         Print info level logs.
  --noisy               Print all logs.
  -s SERVER, --server=SERVER
                        The server to connect to.
  --insecure            Use HTTP when communicating with the server.
  -e EMAIL, --email=EMAIL
                        The username to use. Will prompt if omitted.
  -H HOST, --host=HOST  Overrides the Host header sent with all RPCs.
  --no_cookies          Do not save authentication cookies to local disk.
  --passin              Read the login password from stdin.
  -A APP_ID, --application=APP_ID
                        Override application from app.yaml file.
  -V VERSION, --version=VERSION
                        Override (major) version from app.yaml file.
  -n NUM_DAYS, --num_days=NUM_DAYS
                        Number of days worth of log data to get. The cut-off
                        point is midnight UTC. Use 0 to get all available
                        logs. Default is 1, unless --append is also given;
                        then the default is 0.
  -a, --append          Append to existing file.
  --severity=SEVERITY   Severity of app-level log messages to get. The range
                        is 0 (DEBUG) through 4 (CRITICAL). If omitted, only
                        request logs are returned.
  --vhost=VHOST         The virtual host of log messages to get. If omitted,
                        all log messages are returned.
  --include_vhost       Include virtual host in log messages.
  --end_date=END_DATE   End date (as YYYY-MM-DD) of period for log data.
                        Defaults to today.

这篇关于从AppEngine下载日志,包括Python日志语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆