The logwatch documentation says the LogFile
command can handle absolute paths. Accordingly, I have a celery.conf file in /etc/logwatch/conf/services as follows:
Title = "Watchdog Celery worker errors"
LogFile = /var/log/208-celery.log
LogFile = /var/log/234-celery.log
LogFile = /var/log/403-celery.log
LogFile = /var/log/dev-celery.log
(The intention is for the four specified log files to be combined into a single group for logwatch.)
I get this error:
*** Error: There is no logfile defined. Do you have a /etc/logwatch/conf/logfiles//var/log/208-celery.log.conf file ?
*** Error: There is no logfile defined. Do you have a /etc/logwatch/conf/logfiles//var/log/234-celery.log.conf file ?
*** Error: There is no logfile defined. Do you have a /etc/logwatch/conf/logfiles//var/log/403-celery.log.conf file ?
*** Error: There is no logfile defined. Do you have a /etc/logwatch/conf/logfiles//var/log/dev-celery.log.conf file ?
Can't open: /usr/share/logwatch/scripts/services/celery at /usr/sbin/logwatch line 1329.
It seems like logwatch is not interpreting the LogFile
commands as absolute paths for some reason. I have confirmed those log files definitely exist at those paths. As for the "Can't open…" error — my guess is that logwatch is looking for a default configuration due to the lack of working LogFile commands.
So: how do I get logwatch to correctly watch those specific log files?
NOTE: I'm using logwatch v7.4.0 running on Ubuntu 12.04.4 LTS.
Best Answer
The
LogFile
entries in the config files underservices
refer to logfile groups which are defined in the corresponding config file underlogfiles
. See section A of the document you linked to for info about configuring a logfile group ...And section B for referring to these groups in a config file under
services
...The error
/usr/share/logwatch/scripts/services/celery
is because you haven't created a service filter executable as described in section C of the document. You should create this (using the example script) under/etc/logwatch/scripts/services
making sure that it is executable. I've just tried this (logwatch 7.4.0 on CentOS 7.2 and it works as expected.