brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: journalctl -x adds explanation texts to log lines

Journalctl
~/tips/tip-journalctl-catalog-x-explanations

journalctl -xeu nginx.service

Adds catalog explanation texts under log lines that have one, which helps with failed service starts.

Some log lines are cryptic on their own. journald has a message catalog, and -x pulls explanations out of it.

The man page says -x (long form --catalog) augments log lines with explanation texts from the message catalog. The help texts explain the context of an error or log event, possible solutions, and point to support forums or other documentation. It was added in version 196. A common use is a service that fails to start:

journalctl -xeu nginx.service

That is -x for the explanations, -e to jump to the end of the log, and -u to select the unit. For messages that have a catalog entry, extra text appears below the line.

Only selected messages have such a text. The man page says so itself, so many lines look exactly the same with or without -x, and an empty result does not mean the option failed.

A second thing to know: the man page asks you not to use -x when you attach journalctl output to a bug report. For something to paste into a forum or a ticket, run the command again without it:

journalctl -eu nginx.service

To see which messages have an explanation at all, journalctl --list-catalog prints the catalog as a table of message IDs with short descriptions. Pass an ID to look at one entry.

Further reading: systemd: journalctl man page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link