X
X

Select Your Currency

Türk Lirası $ US Dollar
X
X

Select Your Currency

Türk Lirası $ US Dollar

Knowledge Base

How to View Ubuntu Error Logs?

 

When you face an issue on an Ubuntu server or desktop system, checking the log files is the key to understanding the cause. Log files are continuously maintained in the background and almost every error leaves a trace there.

 

Where Are Log Files Located?

 

On Ubuntu and all Debian-based systems, log files are usually located in the following directory:

/var/log/

Under this directory, you will find logs for different parts of the system.

 

Most Common Log Files to Check

 

  • /var/log/syslog
    Records general system events. Hardware errors, network connections, and service startups appear here.

  • /var/log/auth.log
    Contains authentication logs (login attempts, SSH connections, sudo usage).

  • /var/log/kern.log
    Shows kernel-level errors and warnings.

  • /var/log/dmesg
    Displays hardware-related boot messages and errors.

 

How to View Log Files

 

1. Viewing with cat, less, or more

 

Example: to read the syslog file:

sudo less /var/log/syslog

 

2. Viewing Recent Logs with tail

 

To see only the last few lines:

sudo tail /var/log/syslog

 

To follow logs live as they come in:

sudo tail -f /var/log/syslog

 

3. Using journalctl Command

 

On modern Ubuntu systems that use systemd, the journalctl command is also widely used:

sudo journalctl

 

To see the last 100 lines:

sudo journalctl -n 100

 

To check logs for a specific service, for example SSH:

sudo journalctl -u ssh

 

How to Find a Specific Error

 

For example, to search for lines containing the word "error" in the logs:

sudo grep "error" /var/log/syslog

 

For a more detailed search using journalctl and grep together:

sudo journalctl | grep error

 

Why Logs Are Important

 

  • To understand why a service is not working

  • To detect security breaches

  • To identify hardware failures early

  • To analyze performance issues on your server

Did you find it useful?
(0 times viewed / 0 people found it helpful)

Can't find the information you are looking for?

Create a Support Ticket
Top