How to disable sequelize cli log - Sequelize CLI [Node: 10.21.0, CLI: 6.0.0, ORM: 6.1.0]

40 Views Asked by At

I am using sequelize cli to configure postgresql and run migrations/seeders. There are a couple of logs being printed unnecessarily and might also reveal internals of my service. I would want to suppress these logs. The logs seen are as follows.

  1. Loaded configuration file "src/infrastructure/config/config.js".
  2. [4mSequelize CLI [Node: 18.14.2, CLI: 6.6.2, ORM: 6.35.2][24m
  3. No seeders found.

Also, FYI, I have already tried adding logging false in config file, which isn't working.

{
  "development": {
    "username": "username",
    "password": "password",
    "database": "db_name",
    "host": "127.0.0.1",
    "dialect": "mysql",
    "logging": false
  },
  "test": {
    // ...
  }
}
1

There are 1 best solutions below

0
On

The way you have setup to disable logs appears to be correct, however you can also specify the "logging:false" directly where you create your Sequelize connection like below:

sequelize = new Sequelize(process.env[config.use_env_variable], {
      timezone: config.db_configs.timezone,
      logging: false, //specify logging false here
    });