File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
backend/src/main/java/com/ai/lawyer/global/sentry Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ package com .ai .lawyer .global .sentry ;
2+
3+ import io .sentry .Sentry ;
4+ import io .sentry .SentryOptions ;
5+ import jakarta .annotation .PostConstruct ;
6+ import lombok .extern .slf4j .Slf4j ;
7+ import org .springframework .beans .factory .annotation .Value ;
8+ import org .springframework .context .annotation .Configuration ;
9+
10+ @ Slf4j
11+ @ Configuration
12+ public class SentryManualConfig {
13+
14+ @ Value ("${sentry.dsn:}" )
15+ private String sentryDsn ;
16+
17+ @ Value ("${sentry.environment:prod}" )
18+ private String environment ;
19+
20+ @ Value ("${sentry.release:unknown}" )
21+ private String release ;
22+
23+ @ PostConstruct
24+ public void init () {
25+ if (sentryDsn == null || sentryDsn .isBlank ()) {
26+ log .warn ("Sentry DSN not set — skipping Sentry init." );
27+ return ;
28+ }
29+
30+ Sentry .init (options -> {
31+ options .setDsn (sentryDsn );
32+ options .setEnvironment (environment );
33+ options .setRelease (release );
34+ options .setSendDefaultPii (true );
35+ options .setEnableExternalConfiguration (true );
36+ options .setTracesSampleRate (1.0 ); // 100% 트레이스 수집
37+ log .info ("Sentry manually initialized (forcing enable)" );
38+ });
39+ }
40+ }
Original file line number Diff line number Diff line change 1- package com .ai .lawyer .global .test ;
1+ package com .ai .lawyer .global .sentry ;
22
33import io .sentry .Sentry ;
44import org .springframework .web .bind .annotation .GetMapping ;
You can’t perform that action at this time.
0 commit comments