Pino
Capture logs and errors from Pino.
This integration only works in the Node.js and Bun runtimes. Requires SDK version 10.18.0
or higher.
Import name: Sentry.pinoIntegration
The pinoIntegration
adds instrumentation for the pino
library so that calls to the pino logger as captured as logs. Optionally, you can capture calls to the pino logger as errors.
Sentry.init({ integrations: [Sentry.pinoIntegration()], });
Configure how pino logs are captured as Sentry errors.
- Type:
Array<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>
- Default:
[]
Levels that trigger capturing of events. When a pino log message is logged at one of these levels, it will be captured as a Sentry error event.
- Type:
boolean
- Default:
true
By default, Sentry will mark captured errors as handled. Set this to false
if you want to mark them as unhandled instead.
Configure how pino logs are captured as Sentry logs.
- Type:
Array<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>
- Default:
["trace", "debug", "info", "warn", "error", "fatal"]
Levels that trigger capturing of logs. Logs are only captured if enableLogs
is enabled in your Sentry configuration.
pino
:>=8.0.0 <10
Sentry.init({ integrations: [ Sentry.pinoIntegration({ log: { levels: ["info", "warn", "error"] } }), ], });
Sentry.init({ integrations: [ Sentry.pinoIntegration({ error: { levels: ["warn", "error"] } }), ], });
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").