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.

Share:
45,402

Related videos on Youtube

Vsplit
Author by

Vsplit

Updated on July 10, 2022

Comments

  • Vsplit
    Vsplit almost 2 years

    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?

    • Raynos
      Raynos almost 13 years
      Sounds like socket.io is outputting this. You forgot to mention your using socket.io
  • user644745
    user644745 over 12 years
    I just tried this, but I'm getting TypeError: Object #<Object> has no method 'set' ... what's wrong? I have io = require("socket.io")
  • pimvdb
    pimvdb over 12 years
    @user644745: It works for me if you set io to require("socket.io").listen(app) (or something similar). Thanks much for the answer, those logs were verbose and messing up the console.