如何让 logwatch 处理备用 apache 日志?

Mik*_*e B 1 linux centos logwatch apache-2.2

CentOS 5 | Apache 2.2.3 | 日志观察 7.3

大家好,

我在 CentOS 机器上运行 Apache 并托管多个 VirtualHosts。这些虚拟主机中的每一个都有一个单独的访问日志。例如:

/var/log/httpd/example.foo.com-access_log /var/log/httpd/downloads.foo.com-access_log

主站点正在将日志写入 /var/log/httpd/access_log。

LogWatch 似乎只检查主日志文件。我怎么能告诉它也包含其他文件?

我认为 /usr/share/logwatch/scripts/services/http 中的某处可能有一个指针,但我没有在那里看到它。

有什么想法吗?

-M

小智 6

由于默认配置,您提供的日志文件应该在不进行任何更改的情况下被提取

LogFile = httpd/*access_log
LogFile = apache/*access.log.1
LogFile = apache/*access.log
LogFile = apache2/*access.log.1
LogFile = apache2/*access.log
LogFile = apache-ssl/*access.log.1
LogFile = apache-ssl/*access.log
Run Code Online (Sandbox Code Playgroud)

但是你想更具体,你可以在 /etc/logwatch/conf 中创建一个配置文件,比如 /etc/logwatch/conf/logfiles/http.conf

Logfile = /var/log/httpd/downloads.foo.com-access_log
...
...
Run Code Online (Sandbox Code Playgroud)