![How to install sentry in flutter (플러터 센트리 설치 방법)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlG1U4%2Fbtr2r5zLIro%2FY0O38wEJHdG9qTE4LRJ8J0%2Fimg.png)
How to install sentry in flutter (플러터 센트리 설치 방법)공부방/Flutter2023. 3. 7. 16:28
Table of Contents
오늘은 Flutter에 sentry를 적용시켜 볼거에요.
단순 오류만 트래킹 하려고 사용하는 것이기 때문에
추가 기능은 아래 문서에서 찾아서 사용하시면 돼요.
https://docs.sentry.io/platforms/flutter/
Flutter
On this page, we get you up and running with Sentry's SDK, so that it will automatically report errors and exceptions in your application. Get started using a g
docs.sentry.io
1. 먼저 아래 사이트에 들어가서 프로젝트에 최신 버전을 적용시키세요.
https://pub.dev/packages/sentry_flutter
sentry_flutter | Flutter Package
Sentry SDK for Flutter. This package aims to support different Flutter targets by relying on the many platforms supported by Sentry with native SDKs.
pub.dev
아래는 현재 제가 적용한 버전이에요.
sentry_flutter: ^6.22.0
2. 아래 링크에 들어가서
https://docs.sentry.io/platforms/flutter/configuration/options/
dsn 값을 복사하세요.
3. 아래와 같이 적용시키세요.
await SentryFlutter.init(
(options) {
options.dsn = dsn 복사한 값;
// fatal 설정 심각한 오류만 인쇄됨(설정 안하면 잡다한 디버딩 로그들이 다 들어와요)
options.diagnosticLevel = SentryLevel.fatal;
// 디버그 모드를 키면 각종 유용한 디버깅 정보 인쇄 (상용 배포시에는 사용 안하는게 좋다고 합니다.)
options.debug = true
},
appRunner: () => runApp(
const RootApp(),
),
)
자 그럼 아래 오류 발생 코드로 Sentry에 이쁘게 로그가 찍히는 것을 확인해 보세요.
throw 'test';
반응형
'공부방 > Flutter' 카테고리의 다른 글
@soycrab :: 꿀맛코딩
행복한 코딩을 위하여!
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!