Sergio Tapia Sergio Tapia - 6 months ago 15
Ruby Question

What does location mean in my Rails logs?

Here's an example output:

13:25:29 log.1 | method=GET path=/users/auth/github/callback
format=html controller=users/omniauth_callbacks action=github
status=302 duration=829.94 view=0.00 db=25.57

What is the
field in this line, and where is it loaded from?


I believe you are using the lograge gem for logging. There, the location field is set if the request was answered with an HTTP redirect (i.e. an HTTP 301 or HTTP 302). The field contains the full URL where the user was forwarded to.

The field is called location because that's the name of the HTTP header containing this field in the response.