Perform Application Activity Logging


Logging application activity is an encouraged good practice. It makes it easier to debug any errors encountered during application runtime. It is also useful for security concerns, since it can be used during incident response. In addition, these logs can be used to feed Intrusion Detection/Prevention Systems (IDS/IPS).

You can read more about it here.

Install the module:

npm i winston # or yarn

Add then use it in your application like this:

const logger = new (Winston.Logger) ({  transports: [      new (winston.transports.Console)(),      new (winston.transports.File)({ filename: 'application.log' })  ],  level: 'verbose'});