node.js - Node JS with Socket IO Winston Logger not outputting debug -


i'm trying have winston logging output logger.debug node.js/socket.io project i'm working on can't debug show in console.

i create logger with:

var logger = new (winston.logger)({     transports: [         new (winston.transports.console)()         ]     }); 

on connection i'm trying the debug has connected

io.on('connection', function (socket) {      socket.emit('init','init-yes');      logger.debug("socket.on has connected");     logger.log('debug', 'this debug');      ... 

but nothing appears in console. checked out git page still seem not understanding something.

edit suggested updated logger creation to:

var logger = new winston.logger({   transports: [     new winston.transports.console({ level : 'debug' })   ] }); 

but i'm still not getting logger.debug("message here") work.

any appreciated. thank time!

the fine manual states: "note default level of transport info".

since don't set log level transport, messages level below info (like debug) won't shown.

to fix this:

var logger = new winston.logger({   transports: [     new winston.transports.console({ level : 'debug' })   ] }); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -