如何分离uWSGI的日志? [英] How to separate logs of uWSGI?

查看:26
本文介绍了如何分离uWSGI的日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 uwsgi 的日志(如访问日志、请求日志、错误日志)分离到单个文件中.目前这些都在同一个文件中,格式不正确.

I want to separate the logs of uwsgi like access logs, request logs, error logs in individual files. At the moment these all are in same file and not well formatted.

推荐答案

有一些配置指令可以为请求和所有其他消息指定不同的记录器:loggerreq-logger.示例:

There are configuration directives to specify different loggers for requests and all other messages: logger and req-logger. Example:

# uwsgi.ini
req-logger = file:/var/log/uwsgi/uwsgi-req.log
logger = file:/var/log/uwsgi/uwsgi.log

如果您想要非默认格式、过滤或特殊的输出位置,您可以编写自己的日志插件.这是相关页面的链接:http://uwsgi-docs.readthedocs.org/en/latest/Logging.html

If you want nondefault formatting, filtering or a peculiar output location, you could write your own logging plugin. Here's a link the relevant page: http://uwsgi-docs.readthedocs.org/en/latest/Logging.html

这篇关于如何分离uWSGI的日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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