Skip to content

Pino integration isn't working - no logs showing up in the sentry logs dashboardΒ #17910

@tobalsgithub

Description

@tobalsgithub

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

10.19.0

Framework Version

Next 15.5.4

Link to Sentry event

No response

Reproduction Example/SDK Setup

// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from '@sentry/nextjs';

Sentry.init({
  dsn: opt.dsn,

  // Tag data with the appropriate environment
  environment: process.env.NEXT_PUBLIC_APP_ENV || process.env.NODE_ENV,
  enabled: process.env.NODE_ENV === 'production',

  // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
  tracesSampleRate: 1,

  // Setting this option to true will print useful information to the console while you're setting up Sentry.
  debug: false,

  // Enable logs capture
  enableLogs: true,

  // Integrate with Pino logger
  integrations: [Sentry.pinoIntegration()],
});

Here's how I setup my pino logger:

import { pino } from 'pino';

export const logger = pino({
  level: process.env.LOG_LEVEL || 'info',
});

Steps to Reproduce

My impression of the docs is that setting up my sentry config like shown is all that's needed to get logs to automatically flow.

This is not happening as far as I can tell, from any environment.

If I use Sentry.logger.error I do see logs showing up in the sentry dashboard, so the logging functionality in general seems to be working. As far as I can tell it's the pino integration piece that's not working.

Expected Result

My expectation is that all logs from my pino logger will automatically get sent to sentry.

Actual Result

I don't see anything in the sentry dashboard Logs page unless i manually call Sentry.logger.error (or some other variant).

Additional Context

Tip: React with πŸ‘ to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions