diff --git a/server/utils/prisma/index.js b/server/utils/prisma/index.js index 64a63f0748b6abb796822d83ff0de65bc4e6a2fe..05c03eb76e1f137699c7db17e0d37eac6098beae 100644 --- a/server/utils/prisma/index.js +++ b/server/utils/prisma/index.js @@ -5,8 +5,12 @@ const { PrismaClient } = require("@prisma/client"); // npx prisma migrate dev --name init -> ensures that db is in sync with schema // npx prisma migrate reset -> resets the db +const isProd = process.env.NODE_ENV === "production"; +const logLevels = isProd + ? ["error", "info", "warn"] + : ["query", "info", "warn", "error"]; const prisma = new PrismaClient({ - log: ["query", "info", "warn"], + log: logLevels, }); module.exports = prisma;