
Linux System Programming Techniques
By :

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.
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.
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:
new-style-daemon
. The -u
option stands for unit:$> sudo journalctl...