I would like to run my node.js application without the automatic logs it prints in the terminal when answering a request (for example 127.0.0.1 - - [Wed, 20 Jun 2012 09:55:49 GMT] "GET /url HTTP/1.1" 200 1559 "http://localhost:3020/url" ...
). Moreover I would like that my logs from console.log()
still remain visible if possible.
Does anyone know how to do this? I'm running express.js on top of Node.
Thanks
Like brandon is saying I think you are using the logger middleware somewhere in your code. You should disable that part especially in production mode. Use something like this:
app.configure(function(){
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(app.router);
});
app.configure('development', function(){
app.use(express.static(__dirname + '/public'));
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
var oneYear = 31557600000;
app.use(express.static(__dirname + '/public', { maxAge: oneYear }));
app.use(express.errorHandler());
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With