The main system for logging on L10 is systemd journald.
So how do you use it?
Well, in different ways.
And the best way is to use systemctl status on the unit.
That will provide easy access to the last messages that have
been logged for a specific service.
Journalctl can also be used.
It prints the entire journal starting at the oldest message.
In journalctl output, you will notice that important messages
are shown in red.
Well, if you're talking about important messages,
you can also use filtering.
Journalctl minus PR will show only messages
with a priority error and higher.
And that's what you normally are interested in
if something's going wrong.
Journalctl minus F is showing the last 10 lines
of the journal.
And it adds new messages while they are added.
And journalctl minus U on any unit
will show messages for that specific unit only.
You can also use timing options like journalctl minus
minus since 1 hour or journalctl minus minus since today
as the specific timing option.
And use minus over both if you want
to add for both messages, which is giving a lot of information.
Too much information in many cases.
Then there is journalctl minus B,
which shows the current boot log,
and journalctl minus XB, which adds explanation text
to the boot log messages.
Apart from that, you can use journalctl minus X
at any time to get some additional explanation
if you want to.
Journalctl minus minus list boots
will show all boots that have happened.
But that will work on persistent journal only.
And if you want to get information
about a specific boot, well, journalctl minus B3
allows you to do that.
Let me show you a bit.
First, systemctl status on HTTPD.
There you can see the last four lines
are giving information that's coming from the journal.
Now, if I would use journalctl minus U HTTPD,
then I can see a little bit more.
Systemctl status is only showing the last couple of lines,
and journalctl minus U is showing all of them.
Now, can we add an X to that?
Minus U, X, and oh, boy, that doesn't work,
because then the X is at the wrong location.
Minus U specifies unit.
It needs to be followed by the name of the unit.
So if you try minus XU, then you get your explanation
listed in green here.
I don't know if this explanation is very useful,
but it might be interesting to see a bit more.
What I like a lot is journalctl minus PR.
I want to see error messages only.
And there also you can try to put in an X for the explanation.
So you get explanation about the error messages,
which is not always of very high quality.
Is there anything else?
Well, I think this is about it.
This is the most important stuff you
need to know about Journal D.
In the next video, you'll learn how to make it persistent.