Major log files location in Ubuntu
Log files location
All log files are located in /var/log directory. In that directory, there are specific files for each type of logs. For example, system logs, such as kernel activities are logged in syslog
file.
Some of the most common log files in /var/log are:
- In directory apt there is a file
history.log
which saves all the package installation and removal information even the initial system build as Live CD. You can open this file to see this very interesting file. - In directory dist-upgrade there is a file
apt.log
which logs the information during distribution upgrades - In directory installer the log files which are created during installation can be found.
- There is an
apport.log
file which saves information about crashes in your system and reporting them. - The file
auth.log
includes information about the authentication activities such as when you authenticate as root user via sudo. - The file
dpkg.log
saves the low level details of package installation and removal related withdpkg
. You might be aware that theapt
system depends ondpkg
for package installation and removal. boot.log
includes information of each booting.kern.log
saves kernel information such as warnings, errors etc.alternatives.log
includes the history of all the alternatives set by various packages and their removal viaupdate-alternatives
command.- Another important log file is
Xorg.log
which include information about the graphics driver, its failures, warnings etc.
Some other types of Log files may be there depending on your installed packages. For example, My system also includes a log folder nginx which will only be there if you install nginx
package.
Display log
use command
To display a log file, you can use display command like tail
or any editor like vi
To watch a log in real time you can use:
tail -f /var/log/kern.log
All logs can be analysed more easily by using grep
. For example, if I want to find reference to my USB hardware, I could:
tail /var/log/kern.log | grep USB
use Graphic Tool
You can also use enter gnome-system-log
to launch a graphic tool to inspect your logs.
Latest Post
- Dependency injection
- Directives and Pipes
- Data binding
- HTTP Get vs. Post
- Node.js is everywhere
- MongoDB root user
- Combine JavaScript and CSS
- Inline Small JavaScript and CSS
- Minify JavaScript and CSS
- Defer Parsing of JavaScript
- Prefer Async Script Loading
- Components, Bootstrap and DOM
- What is HEAD in git?
- Show the changes in Git.
- What is AngularJS 2?
- Confidence Interval for a Population Mean
- Accuracy vs. Precision
- Sampling Distribution
- Working with the Normal Distribution
- Standardized score - Z score
- Percentile
- Evaluating the Normal Distribution
- What is Nodejs? Advantages and disadvantage?
- How do I debug Nodejs applications?
- Sync directory search using fs.readdirSync