解决uWSGI的请求日志

有时我们需要监听或者查看服务器(uWSGI)是否接到请求,所以我们要查看uWSGI的请求日志信息

uwsgi:
   http: 0.0.0.0:80
  chdir: /export/servers/app/mm
  module: mm.web.wsgi
  processes: 6
  listen : 120
  daemonize: /tmp/uwsgi.log
  pidfile: /tmp/uwsgi.pid
  master: true
  disable-logging : true

disable-logging 的含义是停止输出request log
当是true 时:表示关闭所有请求日志,就不会打印请求日志信息了
当是false时:表示开启所有请求日志,日志会存到daemonize指定的文件中

daemonize: /tmp/uwsgi.log 这个设置会记录uwsgi的进程信息和请求日志信息,格式如下:

[pid: 19300|app: 0|req: 8/12] 10.13.15.113 () {40 vars in 760 bytes} [Thu Apr 11 09:46:39 2019] GET /resource/instance_event/ => generated 2 bytes in 6 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19305|app: 0|req: 3/13] 10.13.15.113 () {40 vars in 771 bytes} [Thu Apr 11 09:46:39 2019] GET /data/instance_hotmap/?args=top => generated 2 bytes in 8 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19304|app: 0|req: 2/14] 10.13.15.113 () {40 vars in 765 bytes} [Thu Apr 11 09:46:42 2019] GET /data/meta-data/?key=ip_list => generated 507 bytes in 8 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19300|app: 0|req: 9/15] 10.13.15.113 () {40 vars in 775 bytes} [Thu Apr 11 09:46:42 2019] GET /data/resource/?key=get_dept_list => generated 324 bytes in 9 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19303|app: 0|req: 2/16] 10.13.15.113 () {40 vars in 777 bytes} [Thu Apr 11 09:46:42 2019] GET /data/resource/?key=get_plant_list => generated 263 bytes in 8 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19301|app: 0|req: 1/17] 10.13.15.113 () {40 vars in 799 bytes} [Thu Apr 11 09:46:42 2019] GET /data/resource/?key=get_instance_package_list => generated 2 bytes in 48 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19305|app: 0|req: 4/18] 10.13.15.113 () {40 vars in 750 bytes} [Thu Apr 11 09:46:42 2019] GET /api/console/deploy/ => generated 588 bytes in 61 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19300|app: 0|req: 10/19] 10.13.15.113 () {40 vars in 752 bytes} [Thu Apr 11 09:46:43 2019] GET /data/deploy/history/ => generated 7485 bytes in 21 msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)
[pid: 19302|app: 0|req: 1/20] 10.13.15.113 () {40 vars in 829 bytes} [Thu Apr 11 09:46:39 2019] GET /slowlog/stats_info_by_time/?type=hour&time=2019-04-11+09:46 => generated 27 bytes in 6158 msecs (HTTP/1.1 500) 2 headers in 77 bytes (1 switches on core 0)
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值