Apache-style recording with Heroku + Rails

How to get Apache-style server logs with Heroku? I am using Rails on the Cedar stack.

"Apache-style" means I would like to see every single HTTP request like this (I really don't care if the format matches exactly the same as Apache):

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 looked at using a Rack-middleware logger , such as Clogger , but I'm not sure if there is an easy way to get write files from (ephemeral) speakers to a central (permanent) storage location.

+5
source share
2 answers

Heroku syslog drains, .

syslog- .

+4

Heroku, , Heroku, URL- .

, , Apache Heroku , - .

config.ru:

require 'clogger'
use Clogger, logger: $stdout,
  format: %Q|$ip - $remote_user [$time_local] "$request" status $response_length "$http_referer" "$http_user_agent"|

:: , Heroku, AWS, IP- 10/8.

, , : .

: "ip1, ip2" $ip (, / -). , , , .

0

All Articles