Filter on url in GCP lots and all my prisma SQL dissapears!!!
This is a plea for prisma to please log on the thread of execution as asyncLocalStorage is used by devops teams so they can filter on requestId or url especially when we get a complaint on a specific request id. all logs EXCEPT our prisma logs come out looking like the 2nd picture and we can filter on ANY of those with a simple right click but only 3rd party library that logs wrong seems to be prisma. We have this code and if the $on ran on the thread that ran the SQL, it would be much better for devops to pinpoint issues -> const prismaClient = new PrismaClient({
datasources: {
db: {
url: databaseUrl,
},
},
log: [
{
emit: 'event', // This setting enables logging via event emitters
level: 'query', // Logs SQL queries
}
],
})
// Example: Using event-based logging
prismaClient.$on('query', (e) => {
logger.info(
});
myContainer.bind<PrismaClient>(TYPES.PrismaClient).toConstantValue(prismaClient);
datasources: {
db: {
url: databaseUrl,
},
},
log: [
{
emit: 'event', // This setting enables logging via event emitters
level: 'query', // Logs SQL queries
}
],
})
// Example: Using event-based logging
prismaClient.$on('query', (e) => {
logger.info(
SQL Query Duration: ${e.duration}ms SQL:${e.query} Params: ${e.params});});
myContainer.bind<PrismaClient>(TYPES.PrismaClient).toConstantValue(prismaClient);
