For large-scale or remote LoRaWAN® deployments, centralizing system logs is essential for efficient diagnostics, historical tracking, and security auditing. This guide walks you through setting up a remote log server using rsyslog on Ubuntu to receive system logs from RAK gateways running WisGateOS 2.
Once configured, your RAK gateways can automatically forward logs to the external server over the Syslog protocol (UDP port 514).
Install rsyslog on the Server
1. Log in to your remote server. This guide uses Ubuntu as an example.
2. Update your package list to ensure you have access to the latest software:
sudo apt update
3. Install the rsyslog package, which provides the system logging service:
sudo apt install rsyslog
4. Start and enable the rsyslog service to launch it automatically at boot:
sudo systemctl start rsyslog
sudo systemctl enable rsyslog
5. Verify that rsyslog is running properly:
sudo systemctl status rsyslog
You should see output indicating the service is active (running).
Configure Remote Log Input and Storage
1. Open the rsyslog configuration file:
sudo nano /etc/rsyslog.conf
2. Uncomment the following lines to enable UDP-based remote log reception:
3. At the bottom of the /etc/rsyslog.conf file, add the following lines to store all remote logs in /var/log/remote/, organized by hostname and program name:
$template RemoteLogs,
"/var/log/remote/%HOSTNAME%/%PROGRAMNAME%.log"
*.* ?RemoteLogs
4. Save and exit the file in Nano:
- Press Ctrl + O to save, then press Enter to confirm.
- Press Ctrl + X to exit Nano.
Create the Log Directory and Set Permissions
sudo mkdir -p /var/log/remote
sudo chown -R syslog:syslog /var/log/remote
sudo chmod -R 755 /var/log/remoteRestart rsyslog
sudo systemctl restart rsyslogOpen UDP Port 514 on the Firewall
sudo ufw allow 514/udp
sudo ufw reloadConfigure the Gateway
1. Log in to the gateway’s Web UI.
2. Navigate to Settings > General Settings > System Log.
3. Configure the following parameters:
Buffer size (KiB): Enter the maximum in-memory log buffer size (e.g., 64)
-
Log expiration: Select a retention period from the dropdown:
- 14 days
- 1 month
- 3 months
- 6 months
- 12 months
External system log server IP address: Enter the IP address of your external syslog server
Port: Enter the port number used by your log server (e.g., 514 for standard syslog).
4. Click Save to apply the configuration.
View Gateway Logs on the Remote Log Server
1. Navigate to the log folder for your gateway:
cd /var/log/remote/2. Enter the folder corresponding to your gateway’s hostname:
cd RAK7240CV2Replace RAK7240CV2 with the actual hostname of your device. Each gateway has its own subdirectory.
3. List the available log files:
lsYou will see log files such as kernel.log, lora_pkt_fwd.log, wisdm.log, and others.
4. View a specific log file. For example, to show the last 20 lines of lora_pkt_fwd.log:
tail -n 20 lora_pkt_fwd.logYou can adjust the number in the command (e.g., 20) to control how many recent log entries are displayed.
Changelog
-
Version 1 - How to Configure an External Log Server for RAK Gateways
- Date Published: 08/06/2025
Updated