S
S
Shoolcs2018-12-17 17:22:35
linux
Shoolcs, 2018-12-17 17:22:35

How to configure rsyslog?

It is necessary to move the logging of the program to separate directories. Set up rotate so that every time the service is restarted, a new log file is created. I have already moved the log to a separate directory. But how to set up something to exclude
"node" and the log is not written to /var/log/syslog ? Thanks in advance ))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shoolcs, 2018-12-18
@noob1

I use the following config file /etc/rsyslog.d/99-node.conf :
:programname, startswith, "node" -/var/log/node/node.log
& ~
But in the /etc/rsyslog.d directory there is the default file, which stores the configuration for writing to syslog, auth, kernel and others. This config is loaded first and therefore it writes everything to syslog.
Whatever writes to syslog, you need to specify this configuration in the master file /etc/rsyslog.conf before writing
$IncludeConfig /etc/rsyslog.d/*.conf .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question