Logfile class - No such file or directory?

5 views
Skip to first unread message

Eric Dykstra

unread,
Aug 13, 2014, 3:23:54 PM8/13/14
to sil...@googlegroups.com
Mike,

On execution, I am getting:

    /usr/local/silkjs/httpd/child.js line 15 (errorHandler):
       (string) Could not initialize log file (/var/www/qcs/logs/sql.log): No such file or directory

However, the file exists, is not empty, and is wide open:

    /var/www/qcs$ ls -l /var/www/qcs/logs/sql.log 
        -rwxrwxrwx 1 w3bd3v w3bd3v 20 Aug 13 15:16 /var/www/qcs/logs/sql.log


Here is the code snippet I am running:

        var LogFile = require('LogFile');
        var sql_log = '/var/www/qcs/logs/sql.log';
        var logfile = new LogFile(sql_log);

        logfile.writeln('--------------------------------------------------------------');

What am I missing?

Thanks,

Eric

Eric Dykstra

unread,
Aug 13, 2014, 3:33:18 PM8/13/14
to sil...@googlegroups.com
Ugh. Mike nailed it. Permissions on /var/www/qcs/logs were too restrictive.

Worst part is - I MUST continue even though my brain clearly needs a break. :)

Michael Schwartz

unread,
Aug 13, 2014, 4:10:53 PM8/13/14
to sil...@googlegroups.com
Glad to help ;)

--
You received this message because you are subscribed to the Google Groups "SilkJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silkjs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Dykstra

unread,
Aug 13, 2014, 8:20:34 PM8/13/14
to sil...@googlegroups.com
Mike,

The log file is over-written each time. I expected new entries would be appended to the existing file.

What am I misunderstanding?

Eric

Mike Schwartz

unread,
Aug 13, 2014, 11:18:32 PM8/13/14
to Eric Dykstra, sil...@googlegroups.com
logfile is truncating the file each time you create it.

I modified the code to not truncate, and pushed it.

Try a pull and build.


Mike Schwartz

Reply all
Reply to author
Forward
0 new messages