How to check system logs in Ubuntu

To troubleshoot issues or monitor system activity in Ubuntu, checking logs is one of the most essential skills. Most logs are stored in plain text under the /var/log/ directory, and you can access them using standard command-line tools.

Viewing Logs with journalctl

Ubuntu uses systemd, so journalctl is the modern way to view system logs.

To see all logs (might be huge):

journalctl

See the latest logs at the bottom:

journalctl -xe

Show logs since the last boot:

journalctl -b

Filter logs by a specific service (e.g., SSH):

journalctl -u ssh

Check logs within a time range:

journalctl --since "2025-06-21 12:00" --until "2025-06-21 14:00"

Follow logs in real time (like tail -f):

journalctl -f

Accessing Traditional Log Files

Ubuntu also stores older-style log files in /var/log.

View system logs:

cat /var/log/syslog

Or use less for easier navigation:

less /var/log/syslog

For authentication-related logs:

less /var/log/auth.log

Check kernel logs:

dmesg

Or filtered with less:

dmesg | less

If you’re debugging an application, look inside its specific log directory under /var/log/, like:

ls /var/log/apache2/
You can then check a specific file:

cat /var/log/apache2/error.log

For newer services using systemd, it’s better to use journalctl, but legacy logs are still useful for scripts, debugging, or grep-based analysis.

Share:

More Posts

How to Install Maven on macOS 2025

What you will read?1 Check for Java Installation2 Install Homebrew (If Not Installed)3 Install Maven via Homebrew4 Verify Environment Variables (Optional)5 Create a Sample Maven

How to Use Google SMTP Server

What you will read?1 Step 1: Enable SMTP Access in Gmail2 Step 2: Secure Connection with TLS3 Step 3: Send an Email via SMTP4 Step

how to install wine on RHEL

What you will read?1 Check RHEL version and CPU architecture2 Update system and install base tools3 Verify subscription and enable CodeReady Builder4 Enable EPEL repository5

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments