I need to implement logging to our sails server. I have found sails logging to file
But I am afraid I don't understand it very well. Intention is to replace console.log with log system.
This is just one example of many places where I need to implement logger:
s3.putObject(params, function (err, data) {
if (err)
console.log(err);
else
console.log("Successfully uploaded " +
//etc
You can use sails.log.error()
, sails.log.warn()
, sails.log.verbose()
, etc to send logs to the console, or even to a file if you configure so in the config/logs.js
file. There you can also specify the level of log to get in the output, or you can do it passing parameters in the sails command line (--verbose
).
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