Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache-style logging with Heroku + Rails

How do I get Apache-style server logs with Heroku? I'm using Rails on the Cedar stack.

"Apache-style" meaning, I'd like to see each individual HTTP request like this (I don't actually care if the format is exactly like Apache's):

66.249.71.85 - - [22/Jan/2012:15:15:04 +0000] "GET /robots.txt HTTP/1.1" 200 149 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

I considered using a Rack-middleware logger like Clogger, but I'm not sure if there is an easy way to get the log files off the (ephemeral) dynos to a central (permanent) storage location.

like image 461
Jo Liss Avatar asked Oct 08 '22 22:10

Jo Liss


1 Answers

Heroku supports syslog drains, so you can just set one up to push requests to another location and read them there.

You can read more about syslog drains here in their documentation.

like image 143
John Feminella Avatar answered Oct 13 '22 10:10

John Feminella