小编Ika*_*ian的帖子

syslog-ng 不会写入日志文件 - “没有这样的文件或目录”

我已经使用下面包含的 conf 文件设置了一个新的 syslog-ng 实例。当我查看 val/log/messages 时,我可以看到消息正试图路由到正确的位置 (var/log/bash)。但我不明白为什么它拒绝查看/写入指定的日志文件。该文件最初并不存在,但我尝试从头开始创建一个文件,并尝试复制另一个工作日志文件并重命名它。还尝试将日志文件的文件权限打开为 777 无济于事。(其他日志文件设置为600)

我怎样才能让它写入指定的日志文件?

以下是来自的相关行/var/log/messages

Feb  6 17:44:35 centos32v2 syslog-ng[31027]: Log statistics; processed='src.internal(s_sys#2)=16', stamp='src.internal(s_sys#2)=1391726082', processed='destination(d_mesg)=16', processed='destination(d_bash)=12', (and so on)

Feb  6 17:50:50 centos32v2 syslog-ng[31027]: Error opening file for writing; filename='“/var/log/bash”', error='No such file or directory (2)'
Run Code Online (Sandbox Code Playgroud)

syslog-ng.conf文件是一个全新的 vanilla 安装,添加了以下几行:

destination d_bash { file(“/var/log/bash”); };
filter f_bash { facility(local1) and level(debug); };
log { source(s_sys); filter(f_bash); destination(d_bash); };
Run Code Online (Sandbox Code Playgroud)

这些行中的每一行看起来都与其他现有条目的格式完全相同。

bash syslog-ng centos syslog

1
推荐指数
1
解决办法
5250
查看次数

标签 统计

bash ×1

centos ×1

syslog ×1

syslog-ng ×1