syslog-ng won't write to log file - "No such file or directory"

5,798

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

Share:
5,798

Related videos on Youtube

Alexandru Kis
Author by

Alexandru Kis

Updated on September 18, 2022

Comments

  • Alexandru Kis
    Alexandru Kis over 1 year

    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.

  • Ricky
    Ricky about 10 years
    Note: that's the difference between windows "smart quotes" and ASCII.
  • Alexandru Kis
    Alexandru Kis about 10 years
    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.
  • Jenny D
    Jenny D about 10 years
    @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.