Logging-on-Rails 5: hide and seek with formatting, readibility and parsing
12 min readNov 1, 2018
Currently under Rails 5.2.1 / Ruby 2.5.1 and I quickly had enough of System.out.prin…
oops, enough of puts
. Anyway. I just want to track what happens in my application: how many milliseconds is taken by this method? Was this called before that? What happened before this error? And such.
To get the info, logging is our messiah. Hallelujah…or not.
As starters, here are some global Rails-independent concepts related to logging:
- Log appenders: https://blog.scalyr.com/2018/01/log-appender/
- Log aggregation: https://stackify.com/log-aggregation-101/
- Structured logging: explanation from DZone or Stackify. I also recommended articles from Jessica Suttles: Part 1, Part 2 and Part 3
- From my Java experience, I am used to Logger Hierarchy: http://tutorials.jenkov.com/java-logging/logger-hierarchy.html