0

I have sequelize set up to log to winston in the config.js file:

"mssql": {
        "username": DB_USER,
        "password": DB_PASS,
        "host": "127.0.0.1",
        "dialect": "mssql",
        logging: winston.info
}

I want to track all queries that are ran on the server, which is why I turned the logging option on.

However, Sequelize seems to log the username and password in these logs for every executed query.

How can I use sequelize logging, but not output the username and password in the logfile?

Note, there is a related question on how to turn logging off entirely: Prevent Sequelize from outputting SQL to the console on execution of query? I just need to not log the username and password, I do need the log.

GavinBelson
  • 2,514
  • 25
  • 36

1 Answers1

1

If you are using other then console.log for logging then try setupping logging in sequelize as follows

logging: (msg) => logger.trace(msg) // for logger
logging: (msg) => winston.info(msg) // for winston

Check this issue for further info.

Nimish Gupta
  • 971
  • 7
  • 17