...
Code Block | ||||
---|---|---|---|---|
| ||||
const cloglog = require('./log/clog'); |
Then in your code, you can use the custom logger as follows:
Code Block | ||||
---|---|---|---|---|
| ||||
// In case of error, in the below code we are also sending metadata such as filepath and err in final log message. cloglog.error(context, payload, {filepath: __filename, err: err}); // In case you want to send debug message cloglog.debug(context, payload, 'This is my debug message'); |
...