Logging with syslog
Log files related to daemons and system processes are located in the /var/log
directory. These log files use a standard protocol called syslog, handled by the syslogd
daemon. Every standard application makes use of syslogd
to log information. This recipe describes how to use syslogd
to log information from a shell script.
Getting ready
Log files help you deduce what is going wrong with a system. It is a good practice to log progress and actions with log file messages. The logger command will place data into log files with syslogd
.
These are some of the standard Linux log files. Some distributions use different names for these files:
Log file | Description |
| Boot log information |
| Apache web server log |
| Post boot kernel information |
| User authentication log |
| System boot up messages |
| Mail server log |
| X server log |
How to do it...
The logger
command allows...