uwsgi配置示例(日誌切割失敗困擾)

啓動

/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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章