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
2 changes: 1 addition & 1 deletion src/main/java/io/avaje/logback/encoder/JsonEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class JsonEncoder extends EncoderBase<ILoggingEvent> {

public JsonEncoder() {
this.json = JsonStream.builder().build();
this.properties = json.properties("component", "env", "timestamp", "level", "logger", "message", "thread", "exception");
this.properties = json.properties("component", "env", "timestamp", "level", "logger", "message", "thread", "stacktrace");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public final class ShortenedThrowableConverter extends ThrowableHandlingConverte

public static final int FULL_MAX_DEPTH_PER_THROWABLE = Integer.MAX_VALUE;
public static final int SHORT_MAX_DEPTH_PER_THROWABLE = 3;
public static final int DEFAULT_MAX_DEPTH_PER_THROWABLE = FULL_MAX_DEPTH_PER_THROWABLE;
public static final int DEFAULT_MAX_DEPTH_PER_THROWABLE = Integer.getInteger("avaje.logback.maxDepthPerThrowable", FULL_MAX_DEPTH_PER_THROWABLE);

public static final int FULL_MAX_LENGTH = Integer.MAX_VALUE;
public static final int SHORT_MAX_LENGTH = 1024;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/avaje/logback/encoder/JsonEncoderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void throwable_usingDefault() {
SimpleMapper simpleMapper = SimpleMapper.builder().build();
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);

assertThat((String)asMap.get("exception")).startsWith("java.lang.NullPointerException: ");
assertThat((String)asMap.get("stacktrace")).startsWith("java.lang.NullPointerException: ");
}

@Test
Expand All @@ -96,7 +96,7 @@ void throwable_usingConverter() {
SimpleMapper simpleMapper = SimpleMapper.builder().build();
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);

assertThat((String)asMap.get("exception")).startsWith("j.l.NullPointerException: ");
assertThat((String)asMap.get("stacktrace")).startsWith("j.l.NullPointerException: ");
}

Throwable createThrowable() {
Expand Down
Loading