Linux Logs – Where Do You Look When Something Goes Wrong?

Unison

Well-known member
VIP

Linux Logs – Where Do You Look When Something Goes Wrong?​

One thing I'm learning with Linux is that when something goes wrong, the system will often tell you why — if you know where to look.

For systems using systemd, one of the most useful commands is:

journalctl

That can produce a huge amount of information, so it's usually better to narrow it down.

For example, to see errors from the current boot:

journalctl -b -p err
To look at the log for a particular service:

systemctl status servicename
or:

journalctl -u servicename
You can also follow a service's log live:

journalctl -u servicename -f
I've found this particularly useful on my Raspberry Pi when working with systemd services. Instead of guessing why something hasn't started, checking systemctl status and journalctl will often point directly at the problem.

Another handy command is:

journalctl -b
which shows messages from the current boot.

I'm slowly finding that troubleshooting Linux becomes much easier once you get into the habit of checking the logs before changing things.

What commands do other Linux users here normally reach for first when something goes wrong?
 
Back
Top