logging

Enable Rsyslog Logging on Debian

This step by step tutorial will take you through how to enable rsyslog logging on Debian 12. Debian 12 bookworm uses systemd-journald logging by default. As such, it has deprecated the use of Rsyslog for logging so as to prevent the log messages being written twice on disk. So, how can you enable rsyslog logging on Debian 12 and higher?

Rsyslog vs Journald

Rsyslog and Systemd-journald are both logging systems commonly used in Linux distributions for collecting and storing log data. However, they have different features, functionalities, and configurations.

Logging is one of the most important aspects of software development. The developers log events like successful completion, warnings, errors, fatal errors, etc. These logs can help developers in various ways like find out the root cause in case of when some failure happens in the future, look for slow parts of the code for optimization, etc. Python provides a module named logging which has a vast API that can be used to log events in Python. We have already covered a very detailed tutorial covering the majority of the API of python logging module . Please feel free to check it if you are interested in learning about it (link below). This tutorial will build on that tutorial and explain how we can configure logging module based on the configuration from dictionary and configuration files. It's recommended to have knowledge of the logging module explained in that tutorial to continue with this tutorial.