Skip to content

Commit

Permalink
[fix] #127 add replaceAll in DiscordAppender to avoid invalid Json error
Browse files Browse the repository at this point in the history
  • Loading branch information
tkdwns414 committed Sep 4, 2024
1 parent dafddb3 commit 7c12925
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ protected void append(ILoggingEvent eventObject) {

String level = eventObject.getLevel().levelStr;
String exceptionBrief = "";
String exceptionDetail = "";
IThrowableProxy throwable = eventObject.getThrowableProxy();

if (throwable != null) {
exceptionBrief = throwable.getClassName() + ": " + throwable.getMessage().replaceAll("\"", "'");
}

if (exceptionBrief.equals("")) {
if (exceptionBrief.isEmpty()) {
exceptionBrief = "EXCEPTION 정보가 남지 않았습니다.";
}

Expand Down Expand Up @@ -99,7 +98,7 @@ protected void append(ILoggingEvent eventObject) {
);

if (throwable != null) {
exceptionDetail = ThrowableProxyUtil.asString(throwable);
String exceptionDetail = ThrowableProxyUtil.asString(throwable);
String exception = exceptionDetail.substring(0, 4000);
discordWebhook.addEmbed(
new EmbedObject()
Expand Down

0 comments on commit 7c12925

Please sign in to comment.