diff --git a/app/libs/prismadb.ts b/app/libs/prismadb.ts index ea4b306..e4ddde0 100644 --- a/app/libs/prismadb.ts +++ b/app/libs/prismadb.ts @@ -5,11 +5,12 @@ declare global { var prisma: PrismaClient | undefined } - -// Create a new PrismaClient instance if there isn't one already -const client = globalThis.prisma || new PrismaClient() +// Create a new PrismaClient instance with logging enabled +const client = globalThis.prisma || new PrismaClient({ + log: ['query', 'info', 'warn', 'error'] // Enables Prisma logs for better debugging +}) // Assign the prisma client to the global object if it doesn't exist if (process.env.NODE_ENV !== 'production') globalThis.prisma = client -export default client; \ No newline at end of file +export default client