From f311404968577f9df4aa752a9e86986f45d3bef7 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Thu, 5 Sep 2019 13:50:13 +0200 Subject: [PATCH] allow control over sequelize logging using ENV variable --- app/models/index.js | 1 + development.env | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/models/index.js b/app/models/index.js index ac4279a..f298a63 100644 --- a/app/models/index.js +++ b/app/models/index.js @@ -12,6 +12,7 @@ config.username = process.env.DB_USERNAME || config.username; config.password = process.env.DB_PASSWORD || config.password; config.database = process.env.DB_NAME || config.database; config.port = process.env.DB_PORT || config.port; +config.logging = parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false; let sequelize; if (config.use_env_variable) { diff --git a/development.env b/development.env index d14d427..b6295c9 100644 --- a/development.env +++ b/development.env @@ -3,6 +3,8 @@ DB_PASSWORD=Password for the database DB_NAME=Database name DB_PORT=Database port +SEQUELIZE_LOGGING=0- no sequelize logging, 1- log to the console + AMAZON_ACCES_KEY_ID=(your-key-here) AMAZON_SECRET_ACCESS_KEY=(your-key-here) AMAZON_REGION=eu-west-1