How to set log level in node.js?



I am trying out the default server.js script and when I run it, the console is full of debug messages. Can I set somehow the logging level so I see only errors for instance?

Example of the messages that I see and that I would like to get rid of:

debug - setting poll timeout
debug - client authorized for
debug - clearing poll timeout
debug - xhr-polling writing 1::
debug - set close timeout for client Dmtq05YdizVtNZFy1S4p

Thank you!


that depends on your application, there is no universal method for that



you can use “morgan” for easy logging.