diff --git a/src/main/java/com/polzzak/domain/notification/entity/NotificationType.java b/src/main/java/com/polzzak/domain/notification/entity/NotificationType.java index 2dd24d9..78f167a 100644 --- a/src/main/java/com/polzzak/domain/notification/entity/NotificationType.java +++ b/src/main/java/com/polzzak/domain/notification/entity/NotificationType.java @@ -42,7 +42,7 @@ public String getParameterWithoutBold(final String parameter) { if (this == STAMP_REQUEST || this == REWARD_REQUEST || this == STAMP_BOARD_COMPLETE || this == REWARDED || this == REWARD_REQUEST_AGAIN || this == REWARD_FAIL || this == CREATED_STAMP_BOARD || this == ISSUED_COUPON || this == REWARDED_REQUEST) { - return String.format(this.message, "'" + parameter + "'"); + return String.format(this.message, parameter); } return String.format(this.message, parameter); } diff --git a/src/main/java/com/polzzak/global/infra/firebase/FirebaseCloudMessageService.java b/src/main/java/com/polzzak/global/infra/firebase/FirebaseCloudMessageService.java index 98c601c..e28998e 100644 --- a/src/main/java/com/polzzak/global/infra/firebase/FirebaseCloudMessageService.java +++ b/src/main/java/com/polzzak/global/infra/firebase/FirebaseCloudMessageService.java @@ -18,8 +18,10 @@ import com.polzzak.domain.user.entity.Member; import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; @Service +@Log4j2 @RequiredArgsConstructor public class FirebaseCloudMessageService { @@ -51,15 +53,16 @@ public void sendPushNotification(Member member, String title, String body, Strin .putData("link", link) .build(); BatchResponse response = null; + log.info("push. token: {}, title: {}, body: {}, link: {}", registrationTokens, title, body, link); try { response = FirebaseMessaging.getInstance().sendEachForMulticast(message); } catch (FirebaseMessagingException e) { + log.warn("fail push."); e.printStackTrace(); } // See the BatchResponse reference documentation // for the contents of response. - System.out.println(response.getSuccessCount() + " messages were sent successfully"); - System.out.println(response); + log.info(response.getSuccessCount() + " messages were sent successfully"); } catch (Exception e) {