Setting up a Raspberry Pi as a syslog server.
mkdir -p /home/pi/files
chmod 777 /home/pi/files
sudo bash
apt-get install syslog-ng -y
# Edit the config file /etc/syslog-ng/syslog-ng.conf
# Change the file permision setting in the config file from 640 to 644
options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);
owner("root"); group("adm"); perm(0644); stats_freq(0);
bad_hostname("^gconfd$");
};
# Put these three lines into the config file too
source s_net { udp(ip(0.0.0.0) port(514)); };
destination d_files { file("/home/pi/files/${YEAR}_${MONTH}_${DAY}__${HOST}"); };
log { source(s_net); destination(d_files); };
# Save the config file, then restart the server
service syslog-ng restart