This blog is part of our Rails 5 series.
to better extract information from logs generated by Rails applications.
Consider a Rails 4.x application
where the request id is used as a log tag by adding following in
The log generated for that application would look like:
As we can see the request id tag is not prepended to the lines containing error details.
If we search the log file by the request id then the error details would not be shown.
In Rails 5
errors in logs show log tags as well
to overcome the problem we saw above.
Please note that the log tag name for request id has changed in Rails 5.
The setting would thus look like as shown below.
This is how the same log will look like in a Rails 5 application.