How can we redirect Redpanda log from syslog to a local file in Ubuntu Linux?

Last updated: August 10, 2026

Problem Statement

When Redpanda is installed on a Ubuntu Linux machine, I see Redpanda logs are in a syslog file. The syslog file contains other application logs, too. I want to have a separate file for the Redpanda log only.
How can we redirect only Redpanda logs to a separate local file? 

Solution

When Redpanda is installed on an Ubuntu Linux machine, the Redpanda systemd service logs will be managed by journald. By default, it is configured to send all service logs to rsyslogd. As a result, Syslog log files contained Redpanda logs and all other application logs managed by systemd.  

You can redirect Redpanda log messages to a separate local file with a custom rsyslog configuration. 


1. Create a new rsyslog configuration file
    Note: Make sure the config file is owned by root. If not, use the following command.
             sudo chown root:root /etc/rsyslog.d/40-redpanda.conf

$ cat << EOF > /etc/rsyslog.d/40-redpanda.conf
if $programname == 'rpk' then /var/log/redpanda.log
& stop
EOF

 

2. Restart rsyslog service

$ sudo systemctl restart rsyslog

3. Check the redpanda.log file

$ ls -l /var/log/redpanda.log
-rw-r----- 1 syslog adm 391391 Dec 18 14:53 /var/log/redpanda.log

Notes

This KB described setting a rsyslog config file to redirect Redpadna logs. We strongly recommend using a centralized log management and observability tool for production deployment.

 

If you have any questions on this notice or need further guidance, please contact customer-success@redpanda.com / support@redpanda.com