Commit b4d22358 by Han Su Kim

Merge pull request #896 from edx/han/logrotate

changes to match currently what's in production for hourly tracking.log
parents 81598c38 bc2bf6aa
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.d/hourly
......@@ -51,14 +51,23 @@
template: dest=/etc/rsyslog.d/99-edx.conf src=edx_rsyslog.j2 owner=root group=root mode=644
notify: restart rsyslogd
- name: Install logrotate configuration for edX
template: dest=/etc/logrotate.d/edx-services src=etc/logrotate.d/edx_logrotate.j2 owner=root group=root mode=644
# This is in common to keep all logrotation config
# in the same role
- name: Create hourly subdirectory in logrotate.d
file: path=/etc/logrotate.d/hourly state=directory
- name: Install logrotate configuration for tracking file
template: dest=/etc/logrotate.d/tracking.log src=etc/logrotate.d/edx_logrotate_tracking_log.j2 owner=root group=root mode=644
template: dest=/etc/logrotate.d/hourly/tracking.log src=etc/logrotate.d/hourly/edx_logrotate_tracking_log.j2 owner=root group=root mode=644
- name: Add logrotate for tracking.log to cron.hourly
copy: src=etc/cron.hourly/logrotate dest=/etc/cron.hourly/logrotate owner=root group=root mode=555
# This is transitional to allow older version of edx to update to new logrotate settings
- name: Remove old tracking.log config from /etc/logrotate.d
file: path=/etc/logrotate.d/tracking.log state=absent
- name: update /etc/hosts
template: src=hosts.j2 dest=/etc/hosts
......
{{ COMMON_LOG_DIR }}/*/edx.log {
create
compress
copytruncate
delaycompress
dateext
missingok
notifempty
daily
rotate 90
size 1M
}
{{ COMMON_LOG_DIR }}/tracking.log {
create
compress
delaycompress
dateext
missingok
notifempty
daily
rotate 365000
size 1M
}
{{ COMMON_LOG_DIR }}/tracking.log {
create
compress
delaycompress
create
dateext
dateformat -%Y%m%d-%s
missingok
nodelaycompress
notifempty
daily
rotate 365000
rotate 16000
size 1M
postrotate
/usr/bin/killall -HUP rsyslogd
endscript
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment