diff --git a/scripts/start.sh b/scripts/start.sh index b3c6adcb..4318ee97 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -18,7 +18,7 @@ cp $PROJECT_ROOT/build/libs/*.jar $JAR_FILE # jar 파일 실행 chmod 755 $JAR_FILE echo "$TIME_NOW > $JAR_FILE 파일 실행" >> $DEPLOY_LOG -nohup java -jar $JAR_FILE > $APP_LOG 2> $ERROR_LOG & +nohup java -jar $JAR_FILE & CURRENT_PID=$(pgrep -f $JAR_FILE) -echo "$TIME_NOW > 실행된 프로세스 아이디 $CURRENT_PID 입니다." >> $DEPLOY_LOG \ No newline at end of file +echo "$TIME_NOW > 실행된 프로세스 아이디 $CURRENT_PID 입니다." >> $DEPLOY_LOG diff --git a/src/main/java/com/kustacks/kuring/admin/presentation/AdminControllerV1.java b/src/main/java/com/kustacks/kuring/admin/presentation/AdminControllerV1.java index d75f0ddc..79f6db32 100644 --- a/src/main/java/com/kustacks/kuring/admin/presentation/AdminControllerV1.java +++ b/src/main/java/com/kustacks/kuring/admin/presentation/AdminControllerV1.java @@ -169,10 +169,10 @@ public ResponseDto enrollFakeNotice(@RequestBody HashMap request LocalDateTime now = LocalDateTime.now(); String fakeNoticePostedDate = now.format(DateTimeFormatter.ofPattern("yyyyMMdd")); - log.info("fake articleId = {}", fakeNoticeArticleId); - log.info("fake postedDate = {}", fakeNoticePostedDate); - log.info("fake subject = {}", fakeNoticeSubject); - log.info("fake category = {}", fakeNoticeCategory); + log.debug("fake articleId = {}", fakeNoticeArticleId); + log.debug("fake postedDate = {}", fakeNoticePostedDate); + log.debug("fake subject = {}", fakeNoticeSubject); + log.debug("fake category = {}", fakeNoticeCategory); try { firebaseService.sendMessage(NoticeMessageDto.builder() @@ -227,8 +227,8 @@ public FakeUpdateResponseDto enrollFakeUpdate(@RequestBody Map r String auth = reqBody.get("auth"); String type = reqBody.get("type"); - log.info("fcm 토큰 = {}", token); - log.info("인증 토큰 = {}\n", auth); + log.debug("fcm 토큰 = {}", token); + log.debug("인증 토큰 = {}\n", auth); boolean isAuthenticated = adminService.checkToken(auth); if (!isAuthenticated) { @@ -247,10 +247,10 @@ public FakeUpdateResponseDto enrollFakeUpdate(@RequestBody Map r String subject = reqBody.get("subject"); String category = reqBody.get("category"); - log.info("제목 = {}", subject); - log.info("아이디 = {}", articleId); - log.info("게시일 = {}", postedDate); - log.info("카테고리 = {}", category); + log.debug("제목 = {}", subject); + log.debug("아이디 = {}", articleId); + log.debug("게시일 = {}", postedDate); + log.debug("카테고리 = {}", category); boolean isCategorySupported = adminService.checkCategory(category); if (!isCategorySupported) { @@ -283,8 +283,8 @@ public FakeUpdateResponseDto enrollFakeUpdate(@RequestBody Map r String title = reqBody.get("title"); String body = reqBody.get("body"); - log.info("제목 = {}", title); - log.info("내용 = {}", body); + log.debug("제목 = {}", title); + log.debug("내용 = {}", body); boolean isTitleValid = adminService.checkTitle(title); if (!isTitleValid) { diff --git a/src/main/java/com/kustacks/kuring/common/exception/handler/CommonExceptionHandler.java b/src/main/java/com/kustacks/kuring/common/exception/handler/CommonExceptionHandler.java index 325c83eb..d7d0b307 100644 --- a/src/main/java/com/kustacks/kuring/common/exception/handler/CommonExceptionHandler.java +++ b/src/main/java/com/kustacks/kuring/common/exception/handler/CommonExceptionHandler.java @@ -19,42 +19,42 @@ public class CommonExceptionHandler { @ExceptionHandler public ResponseEntity MethodArgumentNotValidExceptionHandler(MethodArgumentNotValidException exception) { - log.error("[MethodArgumentNotValidException] {}", exception.getMessage()); + log.warn("[MethodArgumentNotValidException] {}", exception.getMessage()); return ResponseEntity.status(ErrorCode.API_MISSING_PARAM.getHttpStatus()) .body(new ErrorResponse(ErrorCode.API_MISSING_PARAM)); } @ExceptionHandler public ResponseEntity NotFoundExceptionHandler(NotFoundException exception) { - log.error("[NotFoundException] {}", exception.getMessage()); + log.warn("[NotFoundException] {}", exception.getMessage()); return ResponseEntity.status(exception.getErrorCode().getHttpStatus()) .body(new ErrorResponse(exception.getErrorCode())); } @ExceptionHandler(AdminException.class) public ResponseEntity AdminExceptionHandler(AdminException exception) { - log.error("[APIException] {}", exception.getErrorCode().getMessage(), exception); + log.warn("[APIException] {}", exception.getErrorCode().getMessage(), exception); return ResponseEntity.status(exception.getErrorCode().getHttpStatus()) .body(new ErrorResponse(exception.getErrorCode())); } @ExceptionHandler public ResponseEntity MissingServletRequestParameterExceptionHandler(MissingServletRequestParameterException exception) { - log.error("[MissingServletRequestParameterException] {}", exception.getMessage()); + log.warn("[MissingServletRequestParameterException] {}", exception.getMessage()); return ResponseEntity.status(ErrorCode.API_MISSING_PARAM.getHttpStatus()) .body(new ErrorResponse(ErrorCode.API_MISSING_PARAM)); } @ExceptionHandler public ResponseEntity ConstraintViolationExceptionHandler(ConstraintViolationException exception) { - log.error("[ConstraintViolationException] {}", exception.getMessage()); + log.warn("[ConstraintViolationException] {}", exception.getMessage()); return ResponseEntity.status(ErrorCode.API_INVALID_PARAM.getHttpStatus()) .body(new ErrorResponse(ErrorCode.API_INVALID_PARAM)); } @ExceptionHandler public ResponseEntity HttpMediaTypeNotAcceptableExceptionHandler(HttpMediaTypeNotAcceptableException exception) { - log.error("[HttpMediaTypeNotAcceptableException] {}", exception.getMessage()); + log.warn("[HttpMediaTypeNotAcceptableException] {}", exception.getMessage()); return ResponseEntity.status(ErrorCode.API_NOT_ACCEPTABLE.getHttpStatus()) .body(new ErrorResponse(ErrorCode.API_NOT_ACCEPTABLE)); } diff --git a/src/main/java/com/kustacks/kuring/common/interceptor/AuthInterceptor.java b/src/main/java/com/kustacks/kuring/common/interceptor/AuthInterceptor.java index ca8ef358..63bf69c3 100644 --- a/src/main/java/com/kustacks/kuring/common/interceptor/AuthInterceptor.java +++ b/src/main/java/com/kustacks/kuring/common/interceptor/AuthInterceptor.java @@ -2,10 +2,8 @@ import com.kustacks.kuring.common.annotation.CheckSession; import lombok.extern.slf4j.Slf4j; -import org.springframework.lang.Nullable; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; -import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -32,8 +30,8 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons HttpSession session = request.getSession(false); if(session != null) { - log.info("sessionId = {}", session.getId()); - log.info("lastAccessedTime = {}", session.getLastAccessedTime()); + log.debug("sessionId = {}", session.getId()); + log.debug("lastAccessedTime = {}", session.getLastAccessedTime()); } boolean isSessionFromCookie = session != null; @@ -41,7 +39,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons // 세션이 있어야 하는 경우 - 없으면 로그인 페이지로 이동 if(isSessionRequired) { - log.info("isSessionFromCookie = {}", isSessionFromCookie); + log.debug("isSessionFromCookie = {}", isSessionFromCookie); if(isSessionFromCookie) { return true; } else { @@ -60,14 +58,4 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons } } } - - @Override - public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, - @Nullable ModelAndView modelAndView) throws Exception { - } - - @Override - public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, - @Nullable Exception ex) throws Exception { - } } diff --git a/src/main/java/com/kustacks/kuring/message/firebase/FirebaseService.java b/src/main/java/com/kustacks/kuring/message/firebase/FirebaseService.java index 9b606bd1..103b76fc 100644 --- a/src/main/java/com/kustacks/kuring/message/firebase/FirebaseService.java +++ b/src/main/java/com/kustacks/kuring/message/firebase/FirebaseService.java @@ -52,9 +52,7 @@ public void subscribe(String token, String topic) throws FirebaseSubscribeExcept TopicManagementResponse response = firebaseMessaging .subscribeToTopic(List.of(token), ifDevThenAddSuffix(topic).toString()); - if (response.getFailureCount() > 0) { - throw new FirebaseSubscribeException(); - } + responseLoggingAndException(response, "subscribe"); } catch (FirebaseMessagingException | FirebaseSubscribeException exception) { throw new FirebaseSubscribeException(); } @@ -65,9 +63,7 @@ public void unsubscribe(String token, String topic) throws FirebaseUnSubscribeEx TopicManagementResponse response = firebaseMessaging .unsubscribeFromTopic(List.of(token), ifDevThenAddSuffix(topic).toString()); - if (response.getFailureCount() > 0) { - throw new FirebaseUnSubscribeException(); - } + responseLoggingAndException(response, "unsubscribe"); } catch (FirebaseMessagingException | FirebaseUnSubscribeException exception) { throw new FirebaseUnSubscribeException(); } @@ -118,12 +114,12 @@ public void sendNotificationByFcm(List noticeList) { try { this.sendNoticeMessageList(notificationDtoList); log.info("FCM에 {}개의 공지 메세지를 전송했습니다.", notificationDtoList.size()); - log.info("전송된 공지 목록은 다음과 같습니다."); + log.debug("전송된 공지 목록은 다음과 같습니다."); for (Notice notice : noticeList) { - log.info("아이디 = {}, 날짜 = {}, 카테고리 = {}, 제목 = {}", notice.getArticleId(), notice.getPostedDate(), notice.getCategoryName(), notice.getSubject()); + log.debug("아이디 = {}, 날짜 = {}, 카테고리 = {}, 제목 = {}", notice.getArticleId(), notice.getPostedDate(), notice.getCategoryName(), notice.getSubject()); } } catch (FirebaseMessageSendException e) { - log.error("새로운 공지의 FCM 전송에 실패했습니다."); + log.warn("새로운 공지의 FCM 전송에 실패했습니다."); throw new InternalLogicException(ErrorCode.FB_FAIL_SEND, e); } catch (Exception e) { log.error("새로운 공지를 FCM에 보내는 중 알 수 없는 오류가 발생했습니다."); @@ -141,6 +137,13 @@ private void sendNoticeMessageList(List messageDtoList) throws messageDtoList.forEach(this::sendMessage); } + private static void responseLoggingAndException(TopicManagementResponse response, String methodName) throws FirebaseSubscribeException { + if (response.getFailureCount() > 0) { + log.warn("[{}] 구독 실패", methodName); + throw new FirebaseSubscribeException(); + } + } + private String buildTitle(String korName) { return new StringBuilder("[") .append(korName) diff --git a/src/main/java/com/kustacks/kuring/message/firebase/exception/handler/FirebaseExceptionHandler.java b/src/main/java/com/kustacks/kuring/message/firebase/exception/handler/FirebaseExceptionHandler.java index 63fb0308..b2a42e96 100644 --- a/src/main/java/com/kustacks/kuring/message/firebase/exception/handler/FirebaseExceptionHandler.java +++ b/src/main/java/com/kustacks/kuring/message/firebase/exception/handler/FirebaseExceptionHandler.java @@ -13,7 +13,7 @@ public class FirebaseExceptionHandler { @ExceptionHandler public ResponseEntity firebaseCommonExceptionHandler(FirebaseBusinessException exception) { - log.error("[FirebaseBusinessException] {}", exception.getMessage()); + log.warn("[FirebaseBusinessException] {}", exception.getMessage()); return ResponseEntity.status(exception.getErrorCode().getHttpStatus()) .body(new ErrorResponse(exception.getErrorCode())); diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/DepartmentNoticeScraperTemplate.java b/src/main/java/com/kustacks/kuring/worker/scrap/DepartmentNoticeScraperTemplate.java index 6418057b..3e6f09eb 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/DepartmentNoticeScraperTemplate.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/DepartmentNoticeScraperTemplate.java @@ -22,9 +22,9 @@ public class DepartmentNoticeScraperTemplate { public List scrap(DeptInfo deptInfo, Function> decisionMaker) throws InternalLogicException { List requestResults = requestWithDeptInfo(deptInfo, decisionMaker); - log.info("[{}] HTML 파싱 시작", deptInfo.getDeptName()); + log.debug("[{}] HTML 파싱 시작", deptInfo.getDeptName()); List noticeDtoList = htmlParsingFromScrapingResult(deptInfo, requestResults); - log.info("[{}] HTML 파싱 완료", deptInfo.getDeptName()); + log.debug("[{}] HTML 파싱 완료", deptInfo.getDeptName()); for (ComplexNoticeFormatDto complexNoticeFormatDto : noticeDtoList) { if (complexNoticeFormatDto.getNormalNoticeSize() == 0) { @@ -32,16 +32,15 @@ public List scrap(DeptInfo deptInfo, Function requestWithDeptInfo(DeptInfo deptInfo, Function> decisionMaker) { long startTime = System.currentTimeMillis(); - log.info("[{}] HTML 요청", deptInfo.getDeptName()); + log.debug("[{}] HTML 요청", deptInfo.getDeptName()); List reqResults = decisionMaker.apply(deptInfo); - log.info("[{}] HTML 수신", deptInfo.getDeptName()); + log.debug("[{}] HTML 수신", deptInfo.getDeptName()); long endTime = System.currentTimeMillis(); log.info("[{}] 파싱에 소요된 초 = {}", deptInfo.getDeptName(), (endTime - startTime) / 1000.0); diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java index 2757d4ab..38a57bf6 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java @@ -37,9 +37,9 @@ public List scrap(DeptInfo deptInfo) throws InternalLogicException { for (StaffApiClient staffApiClient : staffApiClients) { if (staffApiClient.support(deptInfo)) { - log.info("{} HTML 요청", deptInfo.getDeptName()); + log.debug("{} HTML 요청", deptInfo.getDeptName()); documents = staffApiClient.getHTML(deptInfo); - log.info("{} HTML 수신", deptInfo.getDeptName()); + log.debug("{} HTML 수신", deptInfo.getDeptName()); } } @@ -47,11 +47,11 @@ public List scrap(DeptInfo deptInfo) throws InternalLogicException { List parseResult = new LinkedList<>(); for (StaffHtmlParser htmlParser : htmlParsers) { if (htmlParser.support(deptInfo)) { - log.info("{} HTML 파싱 시작", deptInfo.getDeptName()); + log.debug("{} HTML 파싱 시작", deptInfo.getDeptName()); for (Document document : documents) { parseResult.addAll(htmlParser.parse(document)); } - log.info("{} HTML 파싱 완료", deptInfo.getDeptName()); + log.debug("{} HTML 파싱 완료", deptInfo.getDeptName()); } } @@ -70,6 +70,7 @@ public List scrap(DeptInfo deptInfo) throws InternalLogicException { if (staffDtoList.isEmpty()) { throw new InternalLogicException(ErrorCode.STAFF_SCRAPER_CANNOT_SCRAP); } + log.info("[{}] 파싱된 교직원 수 = {}", deptInfo.getDeptName(), staffDtoList.size()); return staffDtoList; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/client/ProxyJsoupClient.java b/src/main/java/com/kustacks/kuring/worker/scrap/client/ProxyJsoupClient.java index c8a6341c..d79a9dec 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/client/ProxyJsoupClient.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/client/ProxyJsoupClient.java @@ -69,9 +69,9 @@ private Document proxyTemplate(String url, int timeOut, MethodCallback callback) try { return getDocument(url, timeOut, callback, proxyInfo); } catch (SocketTimeoutException e) { - log.error("Jsoup time out 오류 발생. {}", e.getMessage()); + log.warn("Jsoup time out 오류 발생. {}", e.getMessage()); } catch (IOException e) { - log.error("Jsoup 오류 발생. {}", e.getMessage()); + log.warn("Jsoup 오류 발생. {}", e.getMessage()); proxyQueue.poll(); } } @@ -85,7 +85,7 @@ private Document getDocument(String url, int timeOut, MethodCallback callback, P Document document = callback.sendRequest(connection, proxyInfo.getIp(), proxyInfo.getPort()); - log.info("{} 으로 성공!", proxyInfo.ip); + log.info("{} 으로 성공 Scrap 성공", proxyInfo.ip); return document; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/client/auth/ParsingKuisAuthManager.java b/src/main/java/com/kustacks/kuring/worker/scrap/client/auth/ParsingKuisAuthManager.java index 40bf2845..129c1d33 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/client/auth/ParsingKuisAuthManager.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/client/auth/ParsingKuisAuthManager.java @@ -49,7 +49,7 @@ public String getSessionId() { } if (!this.sessionNeedToBeRenew) { // apiSkeletonNeedToBeRenew가 true 이면 sessionNeedToBeRenew는 항상 true이므로 sessionNeedToBeRenew만 검사함. - log.info("세션아이디 갱신 안하고 바로 리턴"); + log.debug("세션아이디 갱신 안하고 바로 리턴"); return parsingKuisAuthProperties.getSession(); } @@ -136,7 +136,7 @@ private boolean isInvalidLoginResponse(ResponseEntity loginResponse) { throw new InternalLogicException(ErrorCode.KU_LOGIN_NO_RESPONSE_BODY); } - log.info(body); + log.debug(body); return !body.contains("success"); } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LatestPageNoticeApiClient.java b/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LatestPageNoticeApiClient.java index ff9accee..3c8a234e 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LatestPageNoticeApiClient.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LatestPageNoticeApiClient.java @@ -60,7 +60,7 @@ public List requestAll(DeptInfo deptInfo) throws InternalLogi ScrapingResultDto resultDto = getScrapingResultDto(i, deptInfo, totalNoticeSize, LATEST_SCRAP_ALL_TIMEOUT); reqResults.add(resultDto); } catch (IOException e) { - log.info("Department Scrap all IOException: {}", e.getMessage()); + log.warn("Department Scrap all IOException: {}", e.getMessage()); } catch (NullPointerException | IndexOutOfBoundsException e) { throw new InternalLogicException(ErrorCode.NOTICE_SCRAPER_CANNOT_PARSE, e); } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LibraryNoticeApiClient.java b/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LibraryNoticeApiClient.java index a0a378ff..dd2a5649 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LibraryNoticeApiClient.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/client/notice/LibraryNoticeApiClient.java @@ -83,12 +83,12 @@ private List convertToCommonFormatDto(List parse(Document document) throws InternalLogicException { String jobPosition = String.valueOf(infos.get(1).childNodeSize() < 2 ? "" : infos.get(1).childNode(1)); if (jobPosition.contains("명예") || jobPosition.contains("대우") || jobPosition.contains("휴직") || !jobPosition.contains("교수")) { - log.info("스크래핑 스킵 -> {} 교수", oneStaffInfo[0]); + log.debug("스크래핑 스킵 -> {} 교수", oneStaffInfo[0]); continue; } diff --git a/src/main/java/com/kustacks/kuring/worker/update/notice/CategoryNoticeUpdater.java b/src/main/java/com/kustacks/kuring/worker/update/notice/CategoryNoticeUpdater.java index afb5f0c3..366b4846 100644 --- a/src/main/java/com/kustacks/kuring/worker/update/notice/CategoryNoticeUpdater.java +++ b/src/main/java/com/kustacks/kuring/worker/update/notice/CategoryNoticeUpdater.java @@ -124,10 +124,10 @@ private List filteringSoonSaveNotices(List scrapR newNotices.add(newNotice); } } catch (IncorrectResultSizeDataAccessException e) { - log.error("오류가 발생한 공지 정보"); - log.error("articleId = {}", notice.getArticleId()); - log.error("postedDate = {}", notice.getPostedDate()); - log.error("subject = {}", notice.getSubject()); + log.warn("오류가 발생한 공지 정보"); + log.warn("articleId = {}", notice.getArticleId()); + log.warn("postedDate = {}", notice.getPostedDate()); + log.warn("subject = {}", notice.getSubject()); } } diff --git a/src/main/java/com/kustacks/kuring/worker/update/notice/DepartmentNoticeUpdater.java b/src/main/java/com/kustacks/kuring/worker/update/notice/DepartmentNoticeUpdater.java index f6dd8c28..4a00db95 100644 --- a/src/main/java/com/kustacks/kuring/worker/update/notice/DepartmentNoticeUpdater.java +++ b/src/main/java/com/kustacks/kuring/worker/update/notice/DepartmentNoticeUpdater.java @@ -159,10 +159,10 @@ private List filteringSoonSaveNotice(List deptInfos; - public StaffUpdater(StaffRepository staffRepository, - StaffScraper staffScraper, - List deptInfos) { - + public StaffUpdater(StaffRepository staffRepository, StaffScraper staffScraper, List deptInfos) { this.staffRepository = staffRepository; - this.staffScraper = staffScraper; this.deptInfos = deptInfos; } @Scheduled(fixedRate = 30, timeUnit = TimeUnit.DAYS) public void update() { - log.info("========== 교직원 업데이트 시작 =========="); // www.konkuk.ac.kr 에서 스크래핑하므로, kuis 로그인 필요 없음 @@ -58,8 +48,7 @@ public void update() { scrapDeptAndConvertToMap(kuStaffDTOMap, deptInfo); successDeptNames.add(deptInfo.getDeptName()); } catch (InternalLogicException e) { - log.error("[StaffScraperException] {}학과 교직원 스크래핑 문제 발생.", deptInfo.getDeptName()); - Sentry.captureException(e); + log.warn("[StaffScraperException] {}학과 교직원 스크래핑 문제 발생.", deptInfo.getDeptName()); } } @@ -109,17 +98,17 @@ private void compareAndUpdateDB(Map kuStaffDTOMap, List + + + + + + + + [%d{yyyy-MM-dd HH:mm:ss}:%-3relative] %magenta([%thread]) %highlight(%-5level) %cyan(%logger{36}) - %msg%n + + + + + + ${LOGS_ABSOLUTE_PATH}/info.log + + + INFO + ACCEPT + DENY + + + [%d{yyyy-MM-dd HH:mm:ss}:%-3relative] %magenta([%thread]) %highlight(%-5level) %cyan(%logger{36}) - %msg%n + + + ${LOGS_ABSOLUTE_PATH}/was-logs/info/info.%d{yyyy-MM-dd}.%i.log.gz + + 50MB + + 30 + 500MB + + + + + ${LOGS_ABSOLUTE_PATH}/warn-or-more.log + + WARN + + + [%d{yyyy-MM-dd HH:mm:ss}:%-3relative] %magenta([%thread]) %highlight(%-5level) %cyan(%logger{36}) - %msg%n + + + ${LOGS_ABSOLUTE_PATH}/was-logs/warn-or-more/warn-or-more.%d{yyyy-MM-dd}.%i.log.gz + + 50MB + + 30 + 500MB + + + + + + + + + diff --git a/src/test/java/com/kustacks/kuring/notice/domain/NoticeTest.java b/src/test/java/com/kustacks/kuring/notice/domain/NoticeTest.java index b992697a..9b623315 100644 --- a/src/test/java/com/kustacks/kuring/notice/domain/NoticeTest.java +++ b/src/test/java/com/kustacks/kuring/notice/domain/NoticeTest.java @@ -16,7 +16,7 @@ class NoticeTest { @ValueSource(strings = {"https://www.example.com", "http://example.com:8080/path/to/resource", "https://library.konkuk.ac.kr/library-guide/bulletins/notice/7192", "http://www.konkuk.ac.kr/do/MessageBoard/ArticleRead.do?forum=notice&sort=6&id=5b50736&cat=0000300001", "http://mae.konkuk.ac.kr/noticeView.do?siteId=MAE&boardSeq=988&menuSeq=6823&categorySeq=0&curBoardDispType=LIST&curPage=12&pageNum=1&seq=179896"}) - void create_member(String url) { + void create_notice(String url) { assertThatCode(() -> new Notice("artice_id", "postDate", "updatedDate", "subject", CategoryName.BACHELOR, false, url)) .doesNotThrowAnyException(); } @@ -24,9 +24,8 @@ void create_member(String url) { @DisplayName("공지의 url 형식 검증 테스트") @ParameterizedTest @ValueSource(strings = {"//www.example.com", "https:/www.example.com", "https://"}) - void member_invalid_email_id(String url) { + void notice_invalid_url(String url) { assertThatThrownBy(() -> new Notice("artice_id", "postDate", "updatedDate", "subject", CategoryName.BACHELOR, false, url)) .isInstanceOf(InternalLogicException.class); } - } diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 9d4fc83f..167921d5 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -4,8 +4,6 @@ spring: username: test # 테스트컨테이너 용이라 노출되도 상관없다 password: test1234 driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver - p6spy: - enable-logging: true flyway: enabled: false jpa: @@ -31,9 +29,14 @@ testcontainers: reuse: enable: true -sentry: - dsn: "" - logging: level: p6spy: debug + +sentry: + dsn: "" + +decorator: + datasource: + p6spy: + enable-logging: true