Send everything in production through the gunicorn logger (allows rotation using USR1). Add a gunicorn logger that emits the logstash format. Move the gunicorn config to the conf subdir. Update the postrotate script to hopefully work.

This commit is contained in:
yackob03 2014-02-04 15:08:49 -05:00
parent f2fef9fcde
commit a6f98570a1
7 changed files with 49 additions and 17 deletions

10
conf/gunicorn_config.py Normal file
View file

@ -0,0 +1,10 @@
bind = 'unix:/tmp/gunicorn.sock'
workers = 8
worker_class = 'gevent'
timeout = 2000
daemon = True
pidfile = '/mnt/logs/gunicorn.pid'
errorlog = '/mnt/logs/application.log'
loglevel = 'debug'
logger_class = 'util.glogger.LogstashLogger'
pythonpath = '.'

9
conf/gunicorn_local.py Normal file
View file

@ -0,0 +1,9 @@
bind = '0.0.0.0:5000'
workers = 2
worker_class = 'gevent'
timeout = 2000
daemon = False
errorlog = '-'
loglevel = 'debug'
logger_class = 'util.glogger.LogstashLogger'
pythonpath = '.'

View file

@ -8,7 +8,7 @@
create 644 root root
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /mnt/logs/nginx.pid`
kill -USR1 `cat /mnt/logs/nginx.pid`
endscript
}
@ -22,7 +22,7 @@
create 644 root root
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /mnt/logs/nginx.pid`
kill -USR1 `cat /mnt/logs/nginx.pid`
endscript
}
@ -36,6 +36,6 @@
create 644 ubuntu ubuntu
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /mnt/logs/gunicorn.pid`
kill -USR1 `cat /mnt/logs/gunicorn.pid`
endscript
}