uwsgi配置示例(日志切割失败困扰)

启动

创新互联公司成立于2013年,是专业互联网技术服务公司,拥有项目成都网站制作、成都网站设计网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元丽江做网站,已为上家服务,为丽江各地企业和个人服务,联系电话:13518219792

/usr/local/bin/uwsgi --ini uwsgi.ini --pidfile /var/run/uwsgi.pid --log-reopen

ini配置实例

[uwsgi]
socket = 127.0.0.1:8010
module = manage:cmp_app
pythonpath = /home/work/cdn/python2.7/lib/python2.7/site-packages
chdir = /home/work/project/
wsgi-file = manage.py
master = true
processes = 4
callable = myapp
daemonize =  /home/work/project/logs/uwsgi.log
disable-logging = true
pidfile = /var/run/uwsgi.pid
py-autoreload = 1
max-requests = 5000
touch-logreopen =  /home/work/project/logs/touchfile

注意

  1. daemonize 不能写相对路径,与touch-logreopen冲突(启动时日志为相对路径,touch reopen后会到chdir下的相对路径)
  2. touch-logreopen 需要启动的时候加上 --log-reopen (reload会导致touch-reopen会失败,不会产生新的日志文件)

参考资料:
https://www.jianshu.com/p/679dee0a4193 推荐看
https://uwsgi-docs-zh.readthedocs.io/zh_CN/latest/WSGIquickstart.html quickstart


分享文章:uwsgi配置示例(日志切割失败困扰)
本文地址:http://pwwzsj.com/article/pgdggh.html