Skip to content

Commit b70a180

Browse files
authored
Merge pull request #30 from DataDog/jinroh/logrotate
Add a logrotate for datadog logs
2 parents a78348a + fd8f71d commit b70a180

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

modules/user_data/templates/install.sh.tftpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
3535
Unattended-Upgrade::Automatic-Reboot-Time "now";
3636
EOF
3737

38+
cp /etc/cron.daily/logrotate /etc/cron.hourly/logrotate
39+
cat <<EOF > /etc/logrotate.d/datadog
40+
/var/log/datadog/*.log {
41+
hourly
42+
rotate 12
43+
compress
44+
missingok
45+
notifempty
46+
}
47+
EOF
48+
3849
%{ if site == "datad0g.com" }
3950
cat <<EOF >> /etc/datadog-agent/datadog.yaml
4051
remote_configuration:

0 commit comments

Comments
 (0)