Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma info log level doesn't emit event #19256

Closed
AndrewSouthpaw opened this issue May 15, 2023 · 3 comments
Closed

Prisma info log level doesn't emit event #19256

AndrewSouthpaw opened this issue May 15, 2023 · 3 comments
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. tech/typescript Issue for tech TypeScript. topic: connection pool topic: logging

Comments

@AndrewSouthpaw
Copy link
Contributor

AndrewSouthpaw commented May 15, 2023

Bug description

When setting the client log level, if you set { emit: 'event', level: 'info' } you won't get a log about the pool initializing with connections. If you set { emit: 'stdout', level: 'info' }, you do.

How to reproduce

Omitting some boilerplate, this will emit a log event when initializing:

const client =   new PrismaClient({
  datasources: { db: { url: '...' } },
  log: [{ emit: "stdout", level: "info" }]
})

await client.$connect()

// emits this log:
// prisma:info Starting a postgresql pool with 21 connections.

While setting it up to emit as an event, we don't get that log about the pool starting:

const client =   new PrismaClient({
  datasources: { db: { url: '...' } },
  log: [{ emit: "event", level: "info" }]
})

client.$on('info', (e) => {
  console.log('info event', e)
})

await client.$connect()

// no event is emitted

Expected behavior

Get the same info printout about the connection pool starting when emitting info levels as events.

Prisma information

Schema not relevant

Environment & setup

  • OS: macOS
  • Database: CRDB v22.8
  • Node.js version: 16.20

Prisma Version

prisma                  : 4.13.0
@prisma/client          : 4.13.0
Current platform        : darwin-arm64
Query Engine (Node-API) : libquery-engine 1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine        : migration-engine-cli 1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
Format Wasm             : @prisma/prisma-fmt-wasm 4.13.0-50.1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a
Default Engines Hash    : 1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a
Studio                  : 0.484.0
Preview Features        : tracing, extendedWhereUnique
@AndrewSouthpaw AndrewSouthpaw added the kind/bug A reported bug. label May 15, 2023
@aqrln aqrln added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. tech/typescript Issue for tech TypeScript. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. topic: logging labels May 16, 2023
@mwanago
Copy link

mwanago commented Jun 18, 2023

I'm experiencing the same issue.

@Jolg42 Jolg42 added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Aug 24, 2023
@Jolg42
Copy link
Member

Jolg42 commented Aug 24, 2023

I could not reproduce with the information you provided 🤔 (and could not either with the latest version)

Is this still an issue for you @AndrewSouthpaw?

@AndrewSouthpaw
Copy link
Contributor Author

Can confirm this is fixed now (or I was just completely wrong originally, who knows)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. tech/typescript Issue for tech TypeScript. topic: connection pool topic: logging
Projects
None yet
Development

No branches or pull requests

5 participants