Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- 코테
- AWS
- Express
- 개발
- Jenkins
- 코딩테스트
- chrome
- kotlin
- 오퍼월
- 티스토리챌린지
- python
- docker
- nuxt
- React
- EC2
- JavaScript
- it
- Next
- 광고 id
- 백준
- nginx
- TypeScript
- react-native
- 오블완
- Android
- 파이썬
- toml
- spring boots
- NanoHttpd
- css
Archives
- Today
- Total
내맘대로 개발일지
[NEXTJS] Sentry 연결 본문
📱테스트 환경
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028",
"next": "15.0.2"
회사에서 오랜만에 nextjs 를 쓸일이 생겨서
하는김에 이것저것 다시 써보기로 하였다 !
오늘 작성할 내용은 Sentry 연결하는 부분이다.
센트리는 10에 9은 쓴다고 생각할 정도로 무료인데
에러를 확인할 수 있다는 점에서 무조건적으로 사용해야한다고 생각할 정도로
중요한데 이걸 설정하는 방법을 이번에 포스팅 해보도록 하겠다.
yarn add @sentry/nextjs
해당 모듈 추가해주고
const { withSentryConfig } = require("@sentry/nextjs");
const nextConfig = {
// Your existing Next.js configuration
};
// Make sure adding Sentry options is the last code to run before exporting
module.exports = withSentryConfig(nextConfig, {
org: "example-org",
project: "example-project",
// An auth token is required for uploading source maps.
authToken: process.env.SENTRY_AUTH_TOKEN,
silent: false, // Can be used to suppress logs
});
next.config.js 수정해주고
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
// Replay may only be enabled for the client-side
integrations: [Sentry.replayIntegration()],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for tracing.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
sentry.client.config 만들어주면 된다.
'Javascript > Next' 카테고리의 다른 글
| [NEXTJS] Google Analytics 연결 (2) | 2024.11.09 |
|---|---|
| [NEXTJS] styled-components 적용 (0) | 2024.11.08 |
| [JavaScript] Canvas 글자에 그림자 효과 (2) | 2023.10.26 |
| [NextJS] base64 Image ReSize (0) | 2023.09.01 |
| [NextJS] blob to base64 바꾸기 (0) | 2023.09.01 |