Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove debugging from an Express app?

I would like to remove the debugging mode. I am using express, redis, socket.io and connect-redis, but I do not know where the debugging mode comes from.

Node debug

Someone has an idea?

like image 554
Vsplit Avatar asked Jul 24 '11 15:07

Vsplit


People also ask

How do I enable debugging in Express app?

To use this module while running the express app, set the DEBUG environment variable to express:* The output generated on running the command is shown below: These logs help in finding any bug in the program and tell which part of the program is creating the problem. This gives logs only of the router part.

What is logger Express?

Morgan — HTTP logging middleware for express. It provides the ability to log incoming requests by specifying the formatting of log instance based on different request related information. For example: :method :url :status :response-time ms - :res[content-length]


2 Answers

Update

To completely remove debugging use:

var io = require('socket.io').listen(app, { log: false }); 

Where app is node.js http server / express etc.


You forgot to mention you are also using socket.io. This is coming from socket.io. You can disable this by configuration:

io.set('log level', 1); // reduce logging 
like image 122
Alfred Avatar answered Oct 22 '22 09:10

Alfred


Just configure the log level to number 1 to avoid income unnecessary messages.

You can figure out more information about Socket.IO options on this link.

like image 42
Ito Avatar answered Oct 22 '22 09:10

Ito