Skip to content

Commit 9a9b799

Browse files
authored
Return ContentType of "application/json" instead of "text/plain" (#90)
1 parent 1fe7449 commit 9a9b799

File tree

1 file changed

+5
-0
lines changed
  • log4j2-ecs-layout/src/main/java/co/elastic/logging/log4j2

1 file changed

+5
-0
lines changed

log4j2-ecs-layout/src/main/java/co/elastic/logging/log4j2/EcsLayout.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ public void encode(LogEvent event, ByteBufferDestination destination) {
123123
helper.encode(text, destination);
124124
}
125125

126+
@Override
127+
public String getContentType() {
128+
return "application/json";
129+
}
130+
126131
private StringBuilder toText(LogEvent event, StringBuilder builder, boolean gcFree) {
127132
EcsJsonSerializer.serializeObjectStart(builder, event.getTimeMillis());
128133
EcsJsonSerializer.serializeLogLevel(builder, event.getLevel().toString());

0 commit comments

Comments
 (0)