The logger utility allows you to quickly write a message to your system log with a single, simple command.
For example, to write the message Hello World to your system log, use the following command: The dmesg command displays the Linux kernel’s message buffer, which is stored in memory. To filter this output and search for the messages you’re interested in, you can pipe it to grep: Other useful commands include the head and tail commands.
I've read many articles that argue how easy it is, implementing steps on both the server side and client/forward side.
head prints the first n lines in a file, while tail prints the last n lines in the file – if you want to view recent log messages, the tail command is particularly useful.
Some applications may not write to the system log and may produce their own log files, which you can manipulate in the same way – you’ll generally find them in the /var/log directory, too.
/var/log Log files from the system and various programs/services, especially login (/var/log/wtmp, which logs all logins and logouts into the system) and syslog (/var/log/messages, where all kernel and system program message are usually stored).
Files in /var/log can often grow indefinitely, and may require cleaning at regular intervals.
Something that is now normally managed via log rotation utilities such as 'logrotate'.
This utility also allows for the automatic rotation compression, removal and mailing of log files.
Linux logs a large amount of events to the disk, where they’re mostly stored in the /var/log directory in plain text.
Most log entries go through the system logging daemon, syslogd, and are written to the system log.
Ubuntu includes a number of ways of viewing these logs, either graphically or from the command-line.
You can also write your own log messages to the system log — particularly useful in scripts.
Similarly if a particular application is not behaving as expected, cranking the debug information up might be desirable, but you don't want this level of debug information mixed in with your logs.