Answer the question
In order to leave comments, you need to log in
How to log correctly in node?
The question is how to log correctly in node, that is, I need information about each request, each accepted and given parameter to be displayed in the logs. Are there plugins for this and will it not be an extra load if there are a lot of logs?
Answer the question
In order to leave comments, you need to log in
As an option:
var log = fs.createWriteStream( __dirname + '/logs/express.log', {flags: 'a'} );
log.write( 'info' );
I use Sentry (albeit for exception handling, but you can also keep logs if you keep within the limit). Up to 5000 events per day - free of charge. For me, the pluses were - no need to create structures for storage, the possibility of a free account, you can keep logs on the client.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question