1

I have set up a fresh instance of syslog-ng using the conf file included below. I can see that messages are trying to route to the right place (var/log/bash) when I look in val/log/messages. But I can't figure out why it refuses to see/write to the designated log file. The file didn't originally exist, but I have tried creating one from scratch, as well as trying to copying over another working log file and renaming it. Also tried opening up the file permissions on the log file to 777 to no avail. (the other log files are set to 600)

How can I get it to write to the designated log file?

Here is the relevant lines from /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)'

The syslog-ng.conf file is a brand new vanilla install, with the following added lines:

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); };

Each of these lines looks to be formatted exactly as the other existing entries.

6

It seems to me that your config file uses the wrong quotes: vs. " So the quotes are seen as part of the name.

“/var/log/bash” -> 93 2f 76 61 72 2f 6c 6f 67 2f 62 61 73 68 94
"/var/log/bash" -> 22 2f 76 61 72 2f 6c 6f 67 2f 62 61 73 68 22

3
  • Note: that's the difference between windows "smart quotes" and ASCII.
    – Ricky
    Feb 7 '14 at 1:39
  • 1
    Well I'll be a monkey's uncle. I should have posted this 3 hours ago before I almost threw my laptop out the window. Thanks all. That did the trick.
    – Ikarian
    Feb 7 '14 at 3:55
  • @Ikarian Since this was the solution, it would be kind of you to accept the answer. See unix.stackexchange.com/help/someone-answers for information on how.
    – Jenny D
    Feb 8 '14 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.