FAQ Database Discussion Community


Node.js Winston logging - exitOnError

node.js,winston
I'm a little confused on what exactly this means. There is an "explanation" on the github page for Winston, that says you can exit, or not exit. Does that mean that the Winston object dies or stays, or that the node.js process dies or stays? Or something else entirely? I...

Nodejs Winston logger - log output to both console and file

node.js,logging,winston
I've written a standard express server with Nodejs and Winston logger. For some reason, the log output is written both to console and the designated log file. Every line in the code: winston.log('info', '**************************************'); Is written to both console and log file. Why is this happening? He is my code:...

Node.js / winston - Can I append log?

node.js,logging,winston
I use winston.log to append log files. Every time I restart my application, the exist log is deleted, and new one is created. Is there any way to append the logs files? so it will deleted just in rotate rule? Here is the relevant code: var winston = require('winston'); var...

Winston Improper Log Configuration

node.js,logging,winston
I have decided to use winston for logging in my node project. I am developing this application on windows platform but ultimatly it would be on a linux platform. Here is the code I have used to configure the logger. /* Custom logging module * to write appropriate logs into...

Query winston log returns empty result

node.js,express,winston
I have a very basic express app. I added winston without any configuration. I create log messages like this: require('winston').info('App started'); and all log messages go into app.out.log. When I vi into the file I see info: App started so default logging using winston seems to work fine. Now I...

node.js winston logger no colors with nohup

node.js,logging,nohup,winston
We are using winston logger in our project with the following transport settings: file: { filename: __base + '/log/server.log', colorize : true, timestamp : true, json : false, prettyPrint : true } If the application is started with nohup, log file is not colorized. It works only without nohup. nohup...

npm winston set log level for basic logging instance

node.js,winston
Setting winston log level to 'debug' in 'easy mode' was not well documented so I've shown an example below (and will submit a PR soon). the answer is winston.level = 'debug' I want to use the winston logging package in a node script and not bother with any config, just...

winston logger not serializing mongodb.ObjectID

javascript,node.js,mongodb,mongoose,winston
I want to finally move away from console.log as a logging system and have been looking into both winston and bunyan. I have a slight preference for winston as for now I want human readable logs in longentries, and bunyan is a bit too chatty with all the extra fields....