问题原文
原帖链接 · raphael · CC BY-SA 4.0
We have a RHEL 8 server where we have a few python applications installed for data management and analysis, notably JupyterHub and Airflow. We have these set up with systemd unit files so we can start, stop, restart them using systemctl and we access their logs using journalctl. Our infrastructure folks in charge of the server have kindly asked to make sure our applications send their log messages to somewhere other than /var/log/messages so they can debug server health without having our applications "polluting" the log. But we have not been able to identify a solution to this.
Is there a way to configure a systemd service so its logs aren't going to /var/log/messages?
If not, what could we be using instead of systemd that exist within the RHEL ecosystem?
已采纳解答
原帖链接 · larsks · CC BY-SA 4.0
systemd doesn't send logs to /var/log/messages; it writes things to the system journal (which you read using journalctl).
If something is writing to /var/log/messages, it's a syslog program like syslog-ng or rsyslog, which is reading from the journal and then writing to files in /var/log. If you want to change that, update your syslog server configuration (or disable it, if you don't want to write there at all).
RHEL systems typically use rsyslog, configured in /etc/rsyslog.conf (and /etc/rsyslog.d).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
