Reading the journal
In this recipe, we'll learn how to read the journal. The journal is systemd's logging facility. All messages that a daemon prints to either stdout or stderr gets added to the journal. But we can find more than just the system daemons logs here. There's also the system's boot messages, among other things.
Knowing how to read the journal enables you to find errors in the system and the daemons more easily.
Getting ready
For this recipe, you'll need to have the new-style-daemon
service running. If you don't have it running on your system, go back to the previous recipe for information on how to start it.
How to do it...
In this recipe, we'll explore how to read the journal and what kind of information we can find in it. We'll also learn how to follow a particular service's log:
- We'll start by examining the logs from our service,
new-style-daemon
. The-u
option stands for unit:$> sudo journalctl...