Heroku router log format

HTTP Routing | Heroku Dev Center

Heroku router log format

info logs
2012-10-11T03:47:20+00:00 heroku[router]: at=info method=GET path=/ host=myapp.herokuapp.com fwd="" dyno=web.1 connect=1ms service=18ms status=200 bytes=13
  • method: HTTP request method
  • path: HTTP request path and query string
  • host: HTTP request Host header value
  • fwd: HTTP request X-Forwarded-For header value
  • dyno: name of the dyno that serviced the request
  • connect: amount of time in milliseconds spent establishing a connection to the backend web process
  • service: amount of time in milliseconds spent proxying data between the backend web process and the client
  • status: HTTP response code
  • bytes: Number of bytes transferred from the backend web process to the client
Error logs
2012-10-11T03:47:20+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path=/ host=myapp.herokuapp.com fwd="" dyno=web.1 connect= service=30000ms status=503 bytes=0
  • code: Heroku error code
  • desc: description of error

ここに書かれてないけど、現在は host のあとに request_id が加わってますね。デバッグ用っぽい。
ところで X-Forwarded-For って何よ。

  • X-Forwarded-For: the originating IP address of the client connecting to the Heroku router


heroku のルータ内で使われるヘッダみたいですね。アクセス元の IP アドレス。