Skip to content

Instantly share code, notes, and snippets.

@apeckham
Created January 31, 2012 17:36
Show Gist options
  • Save apeckham/1711768 to your computer and use it in GitHub Desktop.
Save apeckham/1711768 to your computer and use it in GitHub Desktop.
:syslogtag, isequal, "heroku[nginx]" /var/log/heroku.log
:inputname, isequal, "imtcp" ~
@apeckham
Copy link
Author

/var/log/heroku.log {
hourly
postrotate
gzip -c /var/log/heroku.log.1 >/tmp/logrotate-heroku
/usr/bin/s3cmd put /tmp/logrotate-heroku s3://heroku.logs.urbandictionary.com/$(date +%Y/%m/%Y-%m-%d-%H-%M-%S).log.bz2
/sbin/service rsyslog restart
endscript
}

@apeckham
Copy link
Author

mv /etc/cron.daily/logrotate /etc/cron.hourly/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment