Refactor Prisma logging and connection settings: Remove sensitive connection URL logging for security, and simplify logging configuration to only capture errors in the Prisma client setup.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 11m29s

This commit is contained in:
Julien Froidefond
2025-12-17 15:16:04 +01:00
parent fdedc1cf65
commit 91460930a4

View File

@@ -21,10 +21,6 @@ if (typeof databaseUrl !== "string") {
throw new Error("DATABASE_URL must be a string");
}
// Logger l'URL de connexion (masquer le mot de passe pour la sécurité)
const logUrl = databaseUrl.replace(/:\/\/[^:]+:[^@]+@/, "://***:***@");
console.log(`[Prisma] Connecting to PostgreSQL: ${logUrl}`);
const pool = new Pool({
connectionString: databaseUrl,
});
@@ -39,10 +35,7 @@ export const prisma =
globalForPrisma.prisma ??
new PrismaClient({
adapter,
log:
process.env.NODE_ENV === "development"
? ["query", "error", "warn"]
: ["error"],
log: ["error"],
});
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;