The default StringBuilder constructor starts with a capacity of 16, which is always going to be too low. Playing around with the encoder, the shortest message I could generate was 142 characters long:
{"@timestamp":"2021-10-13T23:04:17.024Z", "log.level": "INFO", "message":"", "ecs.version": "1.2.0","process.thread.name":"","log.logger":""}
and of course most messages are going to be much bigger than that
https://github.com/elastic/ecs-logging-java/blob/c91dd98b2223d008a32d60f4172375eaffba84d3/logback-ecs-encoder/src/main/java/co/elastic/logging/logback/EcsEncoder.java#L98
The default StringBuilder constructor starts with a capacity of 16, which is always going to be too low. Playing around with the encoder, the shortest message I could generate was 142 characters long:
{"@timestamp":"2021-10-13T23:04:17.024Z", "log.level": "INFO", "message":"", "ecs.version": "1.2.0","process.thread.name":"","log.logger":""}
and of course most messages are going to be much bigger than that