There are many different log files that all serve different purposes. When trying to find a log about something, you should start by identifying the most relevant file. Below is a list of common log file locations.
System logs deal with exactly that - the Ubuntu system - as opposed to extra applications added by the user. These logs may contain information about authorizations, system daemons and system messages.
Keeps track of authorization systems, such as password prompts, the
sudo command and remote logins.
Daemons are programs that run in the background, usually without user interaction. For example, display server, SSH sessions, printing services, bluetooth, and more.
Provides debugging information from the Ubuntu system and applications.
Logs from the Linux kernel.
Contains more information about your system. If you can’t find anything in the other logs, it’s probably here.
Some applications also create logs in
/var/log. Below are some examples.
Apache creates several log files in the
/var/log/apache2/ subdirectory. The
access.log file records all requests made to the server to access files.
error.log records all errors thrown by the server.
X11 server logs
The X11 server creates a seperate log file for each of your displays. Display numbers start at zero, so your first display (display 0) will log to
Xorg.0.log. The next display (display 1) would log to
Xorg.1.log, and so on.
Not all log files are designed to be read by humans. Some were made to be parsed by applications. Below are some of examples.
Login failures log
Contains info about login failures. You can view it with the
Last logins log
Contains info about last logins. You can view it with the
Login records log
Contains login info used by other utilities to find out who’s logged in. To view currently logged in users, use the
This is not an exhaustive list!
You can search the web for more locations relevant to what you’re trying to debug. There is also a longer list here.