如何启用uWSGI记录到文件? [英] How to enable uWSGI logging to a file?

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

问题描述

我刚刚使用以下配置在EC2 Ubuntu 14.04 LTS上安装了我的第一台uWSGI服务器:

I have just installed my first uWSGI server on EC2 Ubuntu 14.04 LTS, using the following configuration:

[uwsgi]
http-socket    = :9001
plugin    = python
wsgi-file = foo.wsgi
chdir = /home/bar
process   = 3

uWSGI容器工作正常,但是没有日志记录.按照手册,我添加了以下内容:

The uWSGI container works fine, but has no logging. Following the manual, I've added the following:

logger = file:/tmp/errlog

但是重新启动(使用sudo service uwsgi restart)不起作用-服务器无法使用此配置启动.

But restarting (using sudo service uwsgi restart) did not work - the server would not start with this configuration.

您知道我的ini配置中缺少什么吗?

Any idea what's missing from my ini configuration?

推荐答案

常用"语法是"logto =文件".

The "common" syntax is "logto = file".

logger选项用于高级插件,如果要使用文件",则必须加载日志文件插件(就像加载python插件一样).但老实说,如果您只想登录文件,那么logto绰绰有余

The logger option is used for advanced plugins, if you want to use the 'file' one you have to load the logfile plugin (like you load the python one). But honestly if you only want to log to a file, logto will be more than enough

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

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