Merge "Setup logging in the appliance"

This commit is contained in:
Jenkins 2015-06-08 15:19:50 +00:00 committed by Gerrit Code Review
commit 881883d70b
3 changed files with 19 additions and 1 deletions

View File

@ -5,6 +5,7 @@
with_items:
- python-pip
- python-dev
- logrotate
- name: copy akanda-appliance code
synchronize: src={{ playbook_dir }}/.. dest=/tmp/akanda-appliance
@ -18,6 +19,12 @@
- name: install akanda-appliance
command: python setup.py install chdir=/tmp/akanda-appliance
- name: install akanda gunicorn logging directory
file: path=/var/log/akanda state=directory
- name: install akanda logrotate config
template: src=logrotate.j2 dest=/etc/logrotate.d/akanda
- name: install gunicorn config file
template: src=gunicorn.j2 dest=/etc/akanda_gunicorn_config

View File

@ -8,4 +8,5 @@ worker_class ="sync"
debug = False
daemon = True
pidfile = "/var/run/gunicorn.pid"
errorfile = "/tmp/gunicorn.log"
errorlog = "/var/log/akanda/gunicorn_error.log"
accesslog = "/var/log/akanda/gunicorn_access.log"

View File

@ -0,0 +1,10 @@
/var/log/akanda/*.log {
weekly
rotate 7
compress
missingok
create 644 root root
postrotate
kill -USR1 `cat /var/run/gunicorn.pid`
endscript
}