How to remove debugging from an Express app?
45,402
Solution 1
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
Solution 2
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.
Related videos on Youtube
Author by
Vsplit
Updated on July 10, 2022Comments
-
Vsplit almost 2 years
I would like to remove the debugging mode. I am using
express
,redis
,socket.io
andconnect-redis
, but I do not know where the debugging mode comes from.Someone has an idea?
-
Raynos almost 13 yearsSounds like socket.io is outputting this. You forgot to mention your using socket.io
-
-
user644745 over 12 yearsI just tried this, but I'm getting TypeError: Object #<Object> has no method 'set' ... what's wrong? I have io = require("socket.io")
-
pimvdb over 12 years@user644745: It works for me if you set
io
torequire("socket.io").listen(app)
(or something similar). Thanks much for the answer, those logs were verbose and messing up the console.