如何在 uWSGI 上只记录 5xx 错误 [英] How to log only 5xx errors on uWSGI

查看:26
本文介绍了如何在 uWSGI 上只记录 5xx 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让 uWSGI 只记录服务器错误并避免正常的请求日志,因为文件增长非常快,并且所有请求日志记录对我来说都非常适合 NGINX.

I want to let uWSGI only logging server errors and avoid the normal requests logs, because the file grow very fast, and all the requests logging does NGINX very well for me.

我怎样才能为此正确配置我的 uwsgi.ini?文档对我来说不是很清楚.

How can I properly configurate my uwsgi.ini for that? The documentation is not very clear for me.

推荐答案

最后的解决方案很简单:

Finally the solution was quite simple:

logto = /var/log/uwsgi/uwsgi.log
log-5xx = true
disable-logging = true

根据帮助:

-L|--disable-logging 禁用请求日志

-L|--disable-logging disable request logging

这篇关于如何在 uWSGI 上只记录 5xx 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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