linuxsyslog

I wonder how to add recursively logfiles to syslog?


My need is to send all /var/log/[dir]/*.log files to the rsylog.conf file while i cannot guess what [dir] is or [dir]s are.

I followed https://stackoverflow.com/a/67127263/1469161

I can send /var/log/*/*.log into a list and configure rsylog.conf via a script and then restart the rsyslogd service.

Is it possible to do it dynamically, or recursively into rsylog.conf ?

I can resume : How to add files to the imfile module recursively ?


Solution

  • Sorry :( But it cannot be done yet :

    Any plans on adding support for recursive wildcards in path?

    actually not - it will further complicate already complex code AND drags quite some performance. Note that we need to keep watches on all and every directories in between. I admit I also do not fully understand why such a feature may really be needed. If there is a hard need, it can of course be done. Maybe even as a sponsored project.

    Once it's said :

    Done this way. I'll see if journald can handle such a situation.