[GH-ISSUE #4] tailing multiple files doesn't seem to work #3

Closed
opened 2026-03-03 16:03:34 +03:00 by kerem · 3 comments
Owner

Originally created by @cabbiepete on GitHub (May 3, 2012).
Original GitHub issue: https://github.com/mthenw/frontail/issues/4

I tried the following

node /usr/local/nvm/v0.6.16/bin/frontail /var/log/php_errors.log /var/log/apache2/error.log

And can see the resulting tail command in my ps

tail -F /var/log/php_errors.log /var/log/apache2/error.log

But I am getting nothing in the browser when I browse to port 9001

If I tail just one file it works great.

Originally created by @cabbiepete on GitHub (May 3, 2012). Original GitHub issue: https://github.com/mthenw/frontail/issues/4 I tried the following ``` node /usr/local/nvm/v0.6.16/bin/frontail /var/log/php_errors.log /var/log/apache2/error.log ``` And can see the resulting tail command in my ps ``` tail -F /var/log/php_errors.log /var/log/apache2/error.log ``` But I am getting nothing in the browser when I browse to port 9001 If I tail just one file it works great.
kerem 2026-03-03 16:03:34 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@cabbiepete commented on GitHub (May 3, 2012):

Am running on ubuntu lucid 64bit

Manual tail command works as expected also

<!-- gh-comment-id:5479325 --> @cabbiepete commented on GitHub (May 3, 2012): Am running on ubuntu lucid 64bit Manual tail command works as expected also
Author
Owner

@cabbiepete commented on GitHub (May 3, 2012):

I changed the io.sockets.on('connection part to

io.sockets.on('connection', function (socket) {
    var util = require('util');
    util.log(util.format('files=',files));
    var tail = spawn('tail', ['-n', program.number, files]);
    tail.stdout.on('data', function (data) {
        socket.emit('lines', data.toString('utf-8').split('\n'));
    });
    tail.stderr.on('data', function(data) {
        var msg = util.format('stderr: ', data);
        util.log(msg);
        socket.emit('lines', msg);
    });
    tail.on('exit', function(code) {
        var msg = util.format('child process exited with code: ', code);
        util.log(msg);
        socket.emit('lines', msg);
    });
});

And now I get the following when I refresh the browser after I start it

root@ubuntulucid64:/var/www/pay(develop)# frontail /var/log/php_errors.log /var/log/apache2/error.log
3 May 02:23:16 - files= /var/log/php_errors.log /var/log/apache2/error.log
3 May 02:23:16 - stderr:  <Buffer 74 61 69 6c 3a 20>
3 May 02:23:16 - stderr:  <Buffer 63 61 6e 6e 6f 74 20 6f 70 65 6e 20 60 2f 76 61 72 2f 6c 6f 67 2f 70 68 70 5f 65 72 72 6f 72 73 2e 6c 6f 67 20 2f 76 61 72 2f 6c 6f 67 2f 61 70 61 63 68 ...>
3 May 02:23:16 - stderr:  <Buffer 3a 20 4e 6f 20 73 75 63 68 20 66 69 6c 65 20 6f 72 20 64 69 72 65 63 74 6f 72 79 0a>
3 May 02:23:16 - child process exited with code:  1

I'm not entirely sure but I think we're getting 2 stdouts or something and the code doesn't handle that??

<!-- gh-comment-id:5479827 --> @cabbiepete commented on GitHub (May 3, 2012): I changed the io.sockets.on('connection part to ``` io.sockets.on('connection', function (socket) { var util = require('util'); util.log(util.format('files=',files)); var tail = spawn('tail', ['-n', program.number, files]); tail.stdout.on('data', function (data) { socket.emit('lines', data.toString('utf-8').split('\n')); }); tail.stderr.on('data', function(data) { var msg = util.format('stderr: ', data); util.log(msg); socket.emit('lines', msg); }); tail.on('exit', function(code) { var msg = util.format('child process exited with code: ', code); util.log(msg); socket.emit('lines', msg); }); }); ``` And now I get the following when I refresh the browser after I start it ``` root@ubuntulucid64:/var/www/pay(develop)# frontail /var/log/php_errors.log /var/log/apache2/error.log 3 May 02:23:16 - files= /var/log/php_errors.log /var/log/apache2/error.log 3 May 02:23:16 - stderr: <Buffer 74 61 69 6c 3a 20> 3 May 02:23:16 - stderr: <Buffer 63 61 6e 6e 6f 74 20 6f 70 65 6e 20 60 2f 76 61 72 2f 6c 6f 67 2f 70 68 70 5f 65 72 72 6f 72 73 2e 6c 6f 67 20 2f 76 61 72 2f 6c 6f 67 2f 61 70 61 63 68 ...> 3 May 02:23:16 - stderr: <Buffer 3a 20 4e 6f 20 73 75 63 68 20 66 69 6c 65 20 6f 72 20 64 69 72 65 63 74 6f 72 79 0a> 3 May 02:23:16 - child process exited with code: 1 ``` I'm not entirely sure but I think we're getting 2 stdouts or something and the code doesn't handle that??
Author
Owner

@mthenw commented on GitHub (May 3, 2012):

Hi,
thanks for reporting!
Probably there is a bug in args passing. I will fix it tomorrow :)

<!-- gh-comment-id:5481772 --> @mthenw commented on GitHub (May 3, 2012): Hi, thanks for reporting! Probably there is a bug in args passing. I will fix it tomorrow :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/frontail#3
No description provided.