How to show queries in console log using sails?

Unfortunately this isn't possible with Sails at this time, although the feature has been requested. Your best bet is to inspect the log file provided by your database:

Postgres: How to log PostgreSQL queries?

MySQL: Log all queries in mysql

MongoDB: MongoDB logging all queries


This solution works for sails >= 1.1.

The sails-mysql (as of v1.0.0) adapter uses the machinepack-mysql driver which logs queries to debug. So all that's needed to log all native queries is to enable the debug flag:

DEBUG=query node app.js

The mysql adapter has a debug variable LOG_QUERIES to send all queries to the console.

LOG_QUERIES=true node myFile.js