Pino | Next.js용 Sentry
Source URL: https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/integrations/pino
Pino | Next.js용 Sentry
섹션 제목: “Pino | Next.js용 Sentry”이 통합은 Node.js 런타임에서만 작동합니다. SDK 버전 10.18.0 이상이 필요합니다.
임포트 이름: Sentry.pinoIntegration
pinoIntegration은 pino 라이브러리에 계측을 추가하여 pino 로거 호출을 로그로 캡처합니다. 선택적으로, pino 로거 호출을 오류로 캡처할 수도 있습니다.
Sentry.init({ enableLogs: true, integrations: [Sentry.pinoIntegration()],});pino 로그를 Sentry 오류로 캡처하는 방법을 구성합니다.
- 유형:
Array<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'> - 기본값:
[]
이벤트 캡처를 트리거하는 레벨입니다. pino 로그 메시지가 이 레벨 중 하나로 기록되면 Sentry 오류 이벤트로 캡처됩니다.
- 유형:
boolean - 기본값:
true
기본적으로 Sentry는 캡처된 오류를 handled로 표시합니다. 대신 unhandled로 표시하려면 이를 false로 설정하세요.
pino 로그를 Sentry 로그로 캡처하는 방법을 구성합니다.
- 유형:
Array<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'> - 기본값:
["trace", "debug", "info", "warn", "error", "fatal"]
로그 캡처를 트리거하는 레벨입니다. 로그는 Sentry 구성에서 enableLogs가 활성화된 경우에만 캡처됩니다.
pino:>=8.0.0 <11
Sentry.init({ enableLogs: true, integrations: [ Sentry.pinoIntegration({ log: { levels: ["info", "warn", "error"] } }), ],});Sentry.init({ enableLogs: true, integrations: [ Sentry.pinoIntegration({ error: { levels: ["warn", "error"] } }), ],});