Winter 2014 - January to April 2014 - Updated 2018-08-30 23:15 EDT
/var/log/
IndexSystem technicians need to know what is happening on the system, and Linux provides an extensive logging system. The logging handles logs generated by the Linux kernel and by other processes.
Logging of program and system messages is handled by a syslog process, a process that listens for connections from system programs and writes the messages it receives into log files.
System logging is configured via files in /etc
such as /etc/syslog.conf
, /etc/rsyslog.conf
, etc. The syslog process is started by system start-up scripts such as klogd
, sysklogd
, rsyslogd
, etc. The main daemon (program) name is usually something like syslogd
or rsyslogd
or klogd
.
$ ps laxww | grep syslog
$ ps laxww | grep klogd
Logs are usually stored under directory /var/log/
; but, the configuration file for the syslog
program can put the files anywhere. A useful command to use is one that shows which log files have changed (been modified) recently, using the “time” option to ls
:
$ ls -lt /var/log | less
/etc/init.d/rsyslog
systemd
init file such as /etc/init/rsyslog.conf
$ ls -ld /etc/init*/*syslog*
/etc/syslog.conf
or maybe /etc/rsyslog.conf
$ ls -ld /etc/*syslog*
/var/log/
dmesg
IndexWhere does the system write system logging messages before the system knows what disks it has, or when the disk has an error?
dmesg
command shows the in-memory kernel message ring buffer:
$ dmesg | less
/var/log/
somewhereYou may find some parts of these Lynda.com videos useful for exploring system logs and maintenance. These links require you to have created a free account on lynda.com via the Algonquin Lynda.com Link: