KSystemLog is a system log viewer tool. This program is developed for beginner users, who don't know how to find information about their Linux system, and don't know where log files are.
Rsyslog is an open-source software utility used on UNIX and Unix-like computer systems for forwarding log messages in an IP network. It implements the basic syslog protocol, extends it with content-based filtering, rich filtering capabilities, flexible configuration options and adds features such as using TCP for transport.
The official RSYSLOG website defines the utility as "the rocket-fast system for log processing".
You need two or more computers: the server and one or more client computers.
Server
Frist you have to install the ksystemlog. Then you have to set up the rsyslogd's configuration files. By defautl, the log files are stored in the folder: /var/log. Edit the file /etc/rsyslog.conf and uncomment the following lines:
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
To make an automatic log, you can do it with a configuration file in the folder: /etc/rsyslog.d. For example, the configuration file: 40-test.conf (for more options you can read 50-default.conf):
# Log test generated log messages to file
if $programname == "test" then -/var/log/test.log
& ~
Client
In the client you have to install and configurate the syslogd daemon. For example: /sbin/syslogd -L -R server:514
Usage: syslogd [OPTIONS]
System logging utility
(this version of syslogd ignores /etc/syslog.conf)
-n Run in foreground
-O FILE Log to FILE (default:/var/log/messages)
-l N Log only messages more urgent than prio N (1-8)
-S Smaller output
-s SIZE Max size (KB) before rotation (default:200KB, 0=off)
-b N N rotated logs to keep (default:1, max=99, 0=purge)
-R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)
-L Log locally and via network (default is network only if -R)
To send log messages use the command logger:
Usage: logger [options] [message]
Options:
-d, --udp use UDP (TCP is default)
-i, --id log the process ID too
-f, --file <file> log the contents of this file
-h, --help display this help text and exit
-n, --server <name> write to this remote syslog server
-P, --port <number> use this UDP port
-p, --priority <prio> mark given message with this priority
-s, --stderr output message to standard error as well
-t, --tag <tag> mark every line with this tag
-u, --socket <socket> write to this Unix socket
-V, --version output version information and exit