Sentry-javascript: captureException ๋˜๋Š” captureMessage๊ฐ€ ๊ฐ์ฒด ์ •๋ณด๋ฅผ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2018๋…„ 12์›” 12์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: getsentry/sentry-javascript

์ด๊ฒƒ์€ ์ดˆ๋ณด์ž ์งˆ๋ฌธ ์ผ ์ˆ˜ ์žˆ์ง€๋งŒ JSON.stringify (API_responseObj)๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ captureMessage ๋ฐ captureException์— ๋กœ๊ทธ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.
API_responseObj๋Š” ์ง€๋ฌธ ๋ฐ logentry ๋ฉ”์‹œ์ง€ obj์˜ ์ผ๋ถ€ ํ…์ŠคํŠธ ํ›„์— ์ž˜๋ฆฝ๋‹ˆ๋‹ค.
console.log์— ์˜ํ•ด ๋ฉ”์‹œ์ง€ obj๊ฐ€ ์™„์ „ํ•œ ์ •๋ณด๋ฅผ ๊ฐ–๋Š” ๊ฒƒ๊ณผ ๋™์ผํ•œ ๊ฒƒ์ด ์ถ”๊ฐ€๋˜๋ฉด ๋กœ๊ฑฐ๊ฐ€ ์ฝ˜์†” ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
์™„์ „ํ•œ ๊ฐ์ฒด๋ฅผ ์ธ์‡„ํ•˜๊ธฐ ์œ„ํ•ด JSON.stringify (OBJ)์™€ ๊ฐ™์€ ๋ชจ๋“  ํ‚ค๋ฅผ ๋ฐ˜๋ณตํ•˜์ง€ ์•Š๊ณ  ๋ฌธ์ž์—ด ํ˜•์‹์œผ๋กœ Sentry ๋กœ๊ทธ์— ์™„์ „ํ•œ ์‘๋‹ต ๊ฐ์ฒด๋ฅผ ์ถ”๊ฐ€ ํ•  ์ˆ˜์žˆ๋Š” ๋ฐฉ๋ฒ•์„ ์ œ๊ณต ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

๊ฐ์‚ฌ.

Question

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

์•ˆ๋…• ์นด๋ฐ€,

setExtra๋กœ ์ถ”๊ฐ€ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ช…ํ™•ํžˆ ํ•ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

๋ฌธ์•ˆ ์ธ์‚ฌ,
ํ‚ค ์‡ผ๋ฅด

2018 ๋…„ 12 ์›” 12 ์ผ ์ˆ˜์š”์ผ ์˜คํ›„ 3:39 Kamil Ogรณrek, [email protected] ์ž‘์„ฑ :

์•ˆ๋…•ํ•˜์„ธ์š” @ kishor-bhatt https://github.com/kishor-bhatt , ๋‹น์‹ ์€ ์ด๊ฒƒ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
์ถ”๊ฐ€ ์ปจํ…์ŠคํŠธ ์‚ฌ์šฉ โ€“
https://docs.sentry.io/enriching-error-data/context/?platform=javascript

Sentry.withScope ((๋ฒ”์œ„) => {

scope.setExtra ( "response", API_responseObj);

Sentry.captureException (err);

});

โ€”
๋‹น์‹ ์ด ์–ธ๊ธ‰ ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด๊ฒƒ์„ ๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ๋‹ต์žฅํ•˜๊ณ  GitHub์—์„œ ํ™•์ธํ•˜์„ธ์š”.
https://github.com/getsentry/sentry-javascript/issues/1794#issuecomment-446533014 ,
๋˜๋Š” ์Šค๋ ˆ๋“œ ์Œ์†Œ๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AQIaZTKfeiOdvQhli3awbC6Lu6iDi9jiks5u4NXwgaJpZM4ZPDwn
.

๋ชจ๋“  3 ๋Œ“๊ธ€

์•ˆ๋…•ํ•˜์„ธ์š” @ kishor-bhatt, extra ์ปจํ…์ŠคํŠธ โ€“ https://docs.sentry.io/enriching-error-data/context/?platform=javascript๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ์ด ์ž‘์—…์„ ์ˆ˜ํ–‰ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Sentry.withScope((scope) => {
  scope.setExtra("response", API_responseObj);
  Sentry.captureException(err);
});

์•ˆ๋…• ์นด๋ฐ€,

setExtra๋กœ ์ถ”๊ฐ€ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ช…ํ™•ํžˆ ํ•ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

๋ฌธ์•ˆ ์ธ์‚ฌ,
ํ‚ค ์‡ผ๋ฅด

2018 ๋…„ 12 ์›” 12 ์ผ ์ˆ˜์š”์ผ ์˜คํ›„ 3:39 Kamil Ogรณrek, [email protected] ์ž‘์„ฑ :

์•ˆ๋…•ํ•˜์„ธ์š” @ kishor-bhatt https://github.com/kishor-bhatt , ๋‹น์‹ ์€ ์ด๊ฒƒ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
์ถ”๊ฐ€ ์ปจํ…์ŠคํŠธ ์‚ฌ์šฉ โ€“
https://docs.sentry.io/enriching-error-data/context/?platform=javascript

Sentry.withScope ((๋ฒ”์œ„) => {

scope.setExtra ( "response", API_responseObj);

Sentry.captureException (err);

});

โ€”
๋‹น์‹ ์ด ์–ธ๊ธ‰ ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด๊ฒƒ์„ ๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ๋‹ต์žฅํ•˜๊ณ  GitHub์—์„œ ํ™•์ธํ•˜์„ธ์š”.
https://github.com/getsentry/sentry-javascript/issues/1794#issuecomment-446533014 ,
๋˜๋Š” ์Šค๋ ˆ๋“œ ์Œ์†Œ๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AQIaZTKfeiOdvQhli3awbC6Lu6iDi9jiks5u4NXwgaJpZM4ZPDwn
.

์–ธ์ œ๋“ ์ง€!

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰