serversetup_syslog - dl3ebb/OpenIot GitHub Wiki

Installation of Remote Logging via Syslog

On Ubuntu 24.04, rsyslog is pre-installed but is only configured for local access by default. OpenIot logs via UDP on port 514 to the syslog server. To enable this, we need to configure rsyslog.

1. Open the configuration file:

 sudo nano /etc/rsyslog.conf

2. Locate and modify the following lines:

# provides UDP syslog reception
#module(load="imudp")
#input(type="imudp" port="514")

Change them to:

# provides UDP syslog reception
module(load="imudp")
input(type="imudp" port="514")

This enables logging via UDP.

3. To keep logs organized by host (making it easier to manage), append the following lines to the configuration:

$template remote-incoming-logs, "/var/log/remote/%HOSTNAME%.log"
if $fromhost-ip != "127.0.0.1" then ?remote-incoming-logs

This creates a separate log file for each hostname. The filter on 127.0.0.1 ensures the server does not log its own messages in this directory.

4. Restart the rsyslog service to apply the changes:

sudo systemctl daemon-reload
sudo systemctl restart rsyslog

Testing the Setup

1. In the "Logging" section of OpenIot's configuration, enter the server's address.

2. Under "Device Name", specify a hostname for the device.

After restarting the device, log messages from the device should appear under /var/log/remote/<device_name>.log :


| ← Previous Page (Install Mosquitto) | ↑ Server Setup Main Page | Next Page (Install Webupdate) → |