Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.github.stickerifier.stickerify.bot;

import static com.github.stickerifier.stickerify.logger.StructuredLogger.EXCEPTION_MESSAGE_LOG_KEY;
import static com.github.stickerifier.stickerify.logger.StructuredLogger.FILE_ID_VALUE;
import static com.github.stickerifier.stickerify.logger.StructuredLogger.FILE_PATH_LOG_KEY;
import static com.github.stickerifier.stickerify.logger.StructuredLogger.ORIGINAL_REQUEST_LOG_KEY;
Expand Down Expand Up @@ -88,10 +87,7 @@ public int process(List<Update> updates) {

@Override
public void onException(TelegramException e) {
LOGGER.at(Level.ERROR)
.setCause(e)
.addKeyValue(EXCEPTION_MESSAGE_LOG_KEY, e.getMessage())
.log("An unexpected failure occurred");
LOGGER.at(Level.ERROR).setCause(e).log("An unexpected failure occurred");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public record StructuredLogger(Logger logger) {
private static final String REQUEST_DETAILS_LOG_KEY = "request_details";
private static final String FILE_ID_LOG_KEY = "file_id";
private static final String MIME_TYPE_LOG_KEY = "mime_type";
public static final String EXCEPTION_MESSAGE_LOG_KEY = "exception_message";
public static final String ORIGINAL_REQUEST_LOG_KEY = "original_request";
public static final String FILE_PATH_LOG_KEY = "file_path";
public static final String STICKER_LOG_KEY = "sticker";
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
</pattern>
<message/>
<keyValuePairs/>
<throwableMessage>
<fieldName>exception_message</fieldName>
</throwableMessage>
Comment thread
rob93c marked this conversation as resolved.
<stackTrace/>
</providers>
</encoder>
Expand Down
Loading