diff --git a/config/env/development.js b/config/env/development.js index df4f2a3813..dbf3578576 100644 --- a/config/env/development.js +++ b/config/env/development.js @@ -6,7 +6,9 @@ module.exports = { options: { user: '', pass: '' - } + }, + // Enable mongoose debug mode + debug: process.env.MONGODB_DEBUG || false }, log: { // Can specify one of 'combined', 'common', 'dev', 'short', 'tiny' diff --git a/config/env/production.js b/config/env/production.js index fac8462980..8e5832c75d 100644 --- a/config/env/production.js +++ b/config/env/production.js @@ -8,7 +8,9 @@ module.exports = { options: { user: '', pass: '' - } + }, + // Enable mongoose debug mode + debug: process.env.MONGODB_DEBUG || false }, log: { // Can specify one of 'combined', 'common', 'dev', 'short', 'tiny' diff --git a/config/env/test.js b/config/env/test.js index 34c6ba8553..d6e47d40aa 100644 --- a/config/env/test.js +++ b/config/env/test.js @@ -6,7 +6,9 @@ module.exports = { options: { user: '', pass: '' - } + }, + // Enable mongoose debug mode + debug: process.env.MONGODB_DEBUG || false }, port: process.env.PORT || 3001, app: { diff --git a/config/lib/mongoose.js b/config/lib/mongoose.js index 731abb62b8..5b93ff77bf 100644 --- a/config/lib/mongoose.js +++ b/config/lib/mongoose.js @@ -26,6 +26,10 @@ module.exports.connect = function(cb) { console.error(chalk.red('Could not connect to MongoDB!')); console.log(err); } else { + + // Enabling mongoose debug mode if required + mongoose.set('debug', config.db.debug); + // Load modules _this.loadModels();