센트리를 사용해 모니터링 기능 추가

This commit is contained in:
jinia91
2022-03-01 12:06:36 +09:00
parent 35cb48f6eb
commit e94400c41e
3 changed files with 5 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.0'
implementation 'io.sentry:sentry-spring-boot-starter:5.6.1'
// implementation 'com.querydsl:querydsl-jpa'
implementation 'com.github.node-gradle:gradle-node-plugin:3.1.0'
implementation group: 'org.modelmapper', name: 'modelmapper', version: '2.4.4'

View File

@@ -1,5 +1,6 @@
package myblog.blog.log;
import io.sentry.Sentry;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@@ -49,6 +50,8 @@ public class LogTracer {
} else {
log.info("[{}] {} {} time = {}ms ex={}", traceId.getId(), addSpace(EX_PREFIX, traceId.getLevel()),
traceStatus.getMessage(), resultTimeMs, ex.toString());
Sentry.captureMessage(String.format("[%s] %s %s time = %sms ex = %s",
traceId.getId(),addSpace(START_PREFIX, traceId.getLevel()),traceStatus.getMessage(), resultTimeMs, ex.toString()));
}
releaseTraceId();
}

View File

@@ -28,7 +28,7 @@ public class TagsService {
*/
public void createNewTagsAndArticleTagList(String names, Article article) {
ArrayList<Map<String,String>> tagsDtoArrayList = gson.fromJson(names, ArrayList.class);
List<Map<String,String>> tagsDtoArrayList = gson.fromJson(names, ArrayList.class);
// JsonString -> tag
for (Map<String,String> tags : tagsDtoArrayList) {