千家信息网

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

发表于:2025-01-26 作者:千家信息网编辑
千家信息网最后更新 2025年01月26日,启动/usr/local/bin/uwsgi --ini uwsgi.ini --pidfile /var/run/uwsgi.pid --log-reopenini配置实例[uwsgi]socket
千家信息网最后更新 2025年01月26日uwsgi配置示例(日志切割失败困扰)

启动

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

ini配置实例

[uwsgi]socket = 127.0.0.1:8010module = manage:cmp_apppythonpath = /home/work/cdn/python2.7/lib/python2.7/site-packageschdir = /home/work/project/wsgi-file = manage.pymaster = trueprocesses = 4callable = myappdaemonize =  /home/work/project/logs/uwsgi.logdisable-logging = truepidfile = /var/run/uwsgi.pidpy-autoreload = 1max-requests = 5000touch-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

0