What is the actual syntax to log in SailsJS?
Docs don't have anything, but found the following line in the site's roadmap
"Pull out Sails.log (winston wrapper) as a separate module so it can be used by waterline"
I image it's something like:
Sails.log(...)
Sails.error(...)
Sails.warn(...)
In your controllers, models, services, and anywhere else that the
sails
global is available, you can log with one of:The logging level (that is, the level at which logs will be output to the console) is set in
/config/log.js
.To extend on the Scott Answer, dont forget to add the filePath: property to log.js file... otherwise it will not work :)
So it should be something like:
Answer is changed based on Joseph question.