LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

does not output console.log() #19

Closed rcrd88 closed 13 years ago

rcrd88 commented 13 years ago

I am using latest Express with cluster, my node version is v0.4 var cluster = require('cluster'); var express = require('express'); var app = module.exports = express.createServer();

    app.get('/', function(req, res){

      console.log('New Request'); // this does not output

      res.render('index', { title: 'Express' });
    });

    cluster(app)
        .use(cluster.logger('logs'))
        .use(cluster.stats())
        .use(cluster.pidfiles('pids'))
        .use(cluster.cli())
        .use(cluster.repl(8888))
        .use(cluster.reload(['app.js']))
        .use(cluster.debug())
        .listen(3000);

It doestn't output the message using console.log() in the console or master.log or workers.access.log. I am not sure it is a bug or by design? Thanks

tj commented 13 years ago

in the case above it should write to the worker access log, my examples that have logger() do this, and they do work, the test passes as well

tj commented 13 years ago

master itself will still output to stdout/stderr

rcrd88 commented 13 years ago

sorry, it actually do write to workers.access.log.

and it would be useful output message in the console for easy debuging. :)

Thanks very much!

tj commented 13 years ago

if you need that then just comment out the logger() line, or add it conditionally when in development

rcrd88 commented 13 years ago

Thanks very much, it worked!