Linux Labs

Packages, services, and logs / Stage 10 of 13

The journal as evidence

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 7 · theory · 4 min

Priority is a threshold

A record's source assigns its priority. -p picks a level and everything more severe.

There are eight levels, from the most severe to the lightest:

Level Number
emerg, alert, crit 0, 1, 2
err 3
warning, notice 4, 5
info, debug 6, 7

-p err shows levels 0 to 3. The lab-demo program writes settings-missing with the err priority and start with info. The service sent the cat error about the missing file to the journal as ordinary output, at the info level — and -p err hid it, although that is exactly where the cause of the failure shows.

A narrow selection shows what broke. The full selection of the same service shows the order of events and the details.

Check yourself 1 question

-p err left two lines of the failed run. What will -p warning show?

  • The warning threshold is wider: a warning-level line joins the errors, Failed with result 'exit-code'.

  • -p is a threshold: the chosen level and everything more severe are shown. err is more severe than warning, so the errors stay.

-p warning shows levels 0 to 4: Failed with result 'exit-code' joined settings-missing and Failed to start.

Key points

  • -p sets a threshold: the chosen level and everything more severe.
  • The program picks the priority, and an important detail may sit a level lower.
  • Look for the cause among the errors and for the order of events in the full selection.
Ubuntu 24.04
Loading…