Can I somehow make journalctl print log levels next to actual messages?
I have found the -p
option but that is not what I'm looking for, I want to see both errors and warnings but I want to be able to tell them apart.
The only thing I have found is this from man journalctl
:
When outputting to a tty, lines are colored according to priority: lines of level ERROR and higher are colored red; lines of level NOTICE and higher are highlighted; other lines are displayed normally.
This is nice start, but I would still like to tell apart all 8 levels, not aggregate them in just three.
Best Answer
The one option is to use output formatting options. For example
journalctl -o verbose
will show you all data connected to a particular entry. Example:Here field
PRIORITY
actually points to a message level (in this particular case it'sINFO
level). Levels map in this way:I don't think you can avoid other metadata and only leave message level (correct me if I'm wrong) without some kind of post-processing (custom shell script etc).