I am new in node and I need to have a log file which stores error log details I need guidance to make log file generated using typescript (node)
Hi use log4js module,
var log4js = require('log4js'); //include
var errorLog = {
module: "module name",
location: "location name",
line: "72",
message: err //error object
};
log4js.getLogger().error(errorLog); //writing log file
go through with the log4js documentation for more details about configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With