Commit 64091489 by Joe Blaylock

Add logrotation to Stanford datadog setup

* Datadog logs now get rotated like other system logs
* nginx logs get rotated to have group syslog, so the datadog agent will
  continue to be able to read them
parent ff77f780
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
src=usr/share/datadog/agent/nginx_log_http_response_counter.py src=usr/share/datadog/agent/nginx_log_http_response_counter.py
dest=/usr/share/datadog/agent/nginx_log_http_response_counter.py dest=/usr/share/datadog/agent/nginx_log_http_response_counter.py
owner=root group=root mode=0644 owner=root group=root mode=0644
notify:
- datadog | restart the datadog service
tags: tags:
- datadog - datadog
...@@ -82,6 +84,12 @@ ...@@ -82,6 +84,12 @@
tags: tags:
- datadog - datadog
- name: datadog | Install logrotate configuration for datadog
template: dest=/etc/logrotate.d/datadog src=datadog_logrotate.j2 owner=root group=root mode=644
tags:
- logging
- datadog
# quoting intentional, missing space after line=api_key: also # quoting intentional, missing space after line=api_key: also
# ansible wasn't handling the double quoted yaml properly # ansible wasn't handling the double quoted yaml properly
# otherwise. # otherwise.
......
/var/log/datadog/*.log {
create
compress
copytruncate
delaycompress
dateext
missingok
notifempty
daily
rotate 90
size 1M
}
# Put in place by ansible # Put in place by ansible
{{log_base_dir}}/nginx/access.log { {{log_base_dir}}/nginx/access.log {
create 0640 www-data adm create 0640 www-data syslog
compress compress
delaycompress delaycompress
dateext dateext
......
# Put in place by ansible # Put in place by ansible
{{log_base_dir}}/nginx/error.log { {{log_base_dir}}/nginx/error.log {
create 0640 www-data adm create 0640 www-data syslog
compress compress
delaycompress delaycompress
dateext dateext
......
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