Question
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.
- Loaded configuration file "src/infrastructure/config/config.js".
- [4mSequelize CLI [Node: 18.14.2, CLI: 6.6.2, ORM: 6.35.2][24m
- No seeders found.
Also, FYI, I have already tried adding logging false in config file, which isn't working.
~~~text
~~~text
{
"development": {
"username": "username",
"password": "password",
"database": "db_name",
"host": "127.0.0.1",
"dialect": "mysql",
"logging": false
},
"test": {
// ...
}
}
Answer
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
});`
This answer was originally posted on Stack Overflow. You can find the full discussion here