How To Set Up a Raspberry Pi Syslog Server

View all your devices log messages in a single place.

This tutorial will show you how to set up a Raspberry Pi Syslog server with a Raspbian distro and see all logs in one place.

It also works with other distros, it’s a very simple and straigth forward tutorial.

STEPS

If you already have one up and running, follow the next steps.

Install the service rsyslog

Then edit the file /etc/rsyslog.conf

Here you will look for the following lines and uncomment them.

This is how it should look like

Port 514 is the default, but you may choose a different one if needed.

Once all changes are done to that file, restart the rsyslog service.

Finally, let’s confirm that the service is up and actively listening on the intended port.

First, run sudo service rsyslog status to make sure the service is up and running.

Confirm it’s enabled and actively running, similar to the example below.

Then, use sudo netstat -plan | grep -E “rsyslog|514” to confirm it’s listening on the correct port.

And you should have something like the next example.

All these new logs coming from your devices will be stored in /var/log/, just like this:

Log messages will be saved in the file called syslog, and once it gets full, there will be a syslog.<#> file created and so on everytime it gets full.

To check upcoming syslog messages in real time, you can use the command tail -f /var/log/syslog and as a new log come to the syslog server, it will be prompted in the output by itself.

You can always cancel that action with Ctrl+C.

Now you know how to create a Raspberry Pi Syslog server and collect all your devices’ logs.

I hope you find this post useful. Feel free to leave a comment down below with your thoughts about it.

If you prefer a visual guide, this video walks you through the entire process of setting up a Syslog server on an Raspberry Pi.