Skip to content

Commit

Permalink
Merge pull request #120 from Genti2024/feat/error-log
Browse files Browse the repository at this point in the history
Feat #56 예외 Discord Appender 수정
  • Loading branch information
LeeJae-H authored Aug 17, 2024
2 parents 1d4fbe3 + eec7a3c commit 8f63a7a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ protected void append(ILoggingEvent eventObject) {
log.info("{}", eventObject.getMessage());

if (throwable != null) {
exceptionBrief = throwable.getClassName() + ": " + throwable.getMessage();
if(throwable instanceof ExpectedException expectedException) {
exceptionBrief += expectedException.getClass().getSimpleName() + " : ";
exceptionBrief += expectedException.getResponseCode().name() + " : ";
exceptionBrief += expectedException.getResponseCode().getErrorCode();
} else{
exceptionBrief = throwable.getClass().getSimpleName() + " : " + throwable.getMessage();
}
}

if (exceptionBrief.isEmpty()) {
Expand Down Expand Up @@ -121,7 +127,7 @@ protected void append(ILoggingEvent eventObject) {

if (throwable != null) {
exceptionDetail = ThrowableProxyUtil.asString(throwable);
String exception = exceptionDetail.substring(0, 4000);
String exception = exceptionDetail.substring(0, 500);
discordWebhook.addEmbed(
EmbedObject.builder()
.title("[Exception 상세 내용]")
Expand Down

0 comments on commit 8f63a7a

Please sign in to comment.