diff --git a/logback-ecs-encoder/src/main/java/co/elastic/logging/logback/EcsEncoder.java b/logback-ecs-encoder/src/main/java/co/elastic/logging/logback/EcsEncoder.java index 80ecf1e1..f961fb73 100644 --- a/logback-ecs-encoder/src/main/java/co/elastic/logging/logback/EcsEncoder.java +++ b/logback-ecs-encoder/src/main/java/co/elastic/logging/logback/EcsEncoder.java @@ -95,7 +95,7 @@ public void close() throws IOException { @Override public byte[] encode(ILoggingEvent event) { - StringBuilder builder = new StringBuilder(); + StringBuilder builder = new StringBuilder(256); EcsJsonSerializer.serializeObjectStart(builder, event.getTimeStamp()); EcsJsonSerializer.serializeLogLevel(builder, event.getLevel().toString()); EcsJsonSerializer.serializeFormattedMessage(builder, event.getFormattedMessage());