node.js - In Winston logging module,why that sending logs with different level is not working -


in node application i'm using winston module store application logs.i have tried store logs in different level , in different files.in situation i'm getting error "error: transport attached: file".

my code

  var winston=require('winston');   winston.add(winston.transports.file, { filename: './logfile.log',level:'error' });   winston.add(winston.transports.file, { filename: './logfile1.log',level:'warn' });   winston.add(winston.transports.file, { filename: './logfile2.log',level:'debug'});    winston.log('error', 'error message!');//this should go logfile.log   winston.log('warn', 'warning message!');//this should go logfile1.log   winston.log('debug', 'debug message!');//this should go logfile2.log 

the winston support 1 file transfer in instance ,you can make more instance handle difference level log.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -