Junior Track Roadmap

Rails logs & stack traces

This course covers two kinds of records a Rails app leaves behind: the development log and Ruby stack traces. It starts with where log/development.log lives and how this app's production environment logs to standard output instead. It then breaks down the Started, Processing by, Parameters and Completed lines, and follows a request halted by a before_action filter. The second half reads a NoMethodError backtrace, picks out the app's own frame among gem frames, and sets a reading order: exception class and message first, then the first frame outside /gems/.

What you'll learn

  • ✓Where Rails writes logs in development and production
  • ✓What the Started, Processing by, Parameters and Completed lines each report
  • ✓How to read a request halted by a before_action filter and redirected
  • ✓How a Ruby backtrace is ordered and what each frame line contains
  • ✓How to find the app's own frame among gem frames using the /gems/ path segment
  • ✓Why to read the exception class and message before any backtrace line
Free preview · Lesson 1 2 min read

Where Rails logs live

A request fails somewhere, with no browser dev tools open and nobody watching. Rails wrote down what happened anyway, in a plain text file. From this project:

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...