【发布时间】:2009-07-13 12:26:32
【问题描述】:
我正在尝试将我所有的 apache 日志发送到 syslog-ng(在远程机器上),然后再写入文件。
所以我以这种方式配置 syslog-ng
source s_apache {
unix-stream("/var/log/apache_log.socket" max-connections(512) keep-alive(yes));
};
filter f_apache { match("error"); };
destination df_custom { file("/var/log/custom.log"); };
log {
source(s_apache);
filter(f_apache);
destination(df_custom);
};
并将以下行添加到 apache2.conf
ErrorLog "|/usr/bin/logger -t 'apache' -u /var/log/apache_log.socket"
但只有写入“/var/log/custom.log”的日志是
[Mon Jul 13 17:24:36 2009] [notice] caught SIGTERM, shutting down
和
[Mon Jul 13 17:26:11 2009] [notice] Apache/2.2.11 (Ubuntu) configured -- resuming normal operations
我希望将所有日志发送到 custom.log ..... 请帮助我....我哪里出错了?
【问题讨论】: