I'm trying to investigate an issue related to long log lines (due to a long stack trace caused by a stack overflow).
It seems that very long lines (exceeding the 500k limit) are truncated to ~32k and are properly indexed on logz.io.
But... long lines over 50k (maybe over 32k?) and under 500k result in an invalid payload and are not properly indexed on logz.io :
Sending log line (len=50000)
10:52:04,581 |-INFO in io.logz.logback.LogzioLogbackAppender[LogzioLogbackAppender] - Successfully sent bulk to logz.io, size: 51187
Sending log line (len=150000)
10:52:14,824 |-INFO in io.logz.logback.LogzioLogbackAppender[LogzioLogbackAppender] - Successfully sent bulk to logz.io, size: 153343
Sending log line (len=200000)
10:52:25,126 |-INFO in io.logz.logback.LogzioLogbackAppender[LogzioLogbackAppender] - Successfully sent bulk to logz.io, size: 204384
Sending log line (len=300000)
10:52:30,452 |-INFO in io.logz.logback.LogzioLogbackAppender[LogzioLogbackAppender] - Successfully sent bulk to logz.io, size: 306492
Sending log line (len=400000)
10:52:35,909 |-INFO in io.logz.logback.LogzioLogbackAppender[LogzioLogbackAppender] - Successfully sent bulk to logz.io, size: 408505
Sending log line (len=500000)
10:52:41,094 |-INFO in io.logz.logback.LogzioLogbackAppender[LogzioLogbackAppender] - Successfully sent bulk to logz.io, size: 33506
I've created a minimal project to play with this limit :
LogzioTest.java
import java.util.InputMismatchException;
import java.util.Scanner;
import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LogzioTest {
@SuppressWarnings("java:S106")
public static void main(String[] args) {
Logger logger = LoggerFactory.getLogger(LogzioTest.class);
try ( Scanner sc = new Scanner(System.in)) {
while (sc.hasNext()) {
try {
int toGen = sc.nextInt();
String toSend = RandomStringUtils.randomPrint(toGen);
System.out.println("Sending log line (len=" + toSend.length() + ")");
logger.info(toSend);
} catch (InputMismatchException ex) {
System.out.println("Please type the number of chars to log...");
sc.next();
}
}
}
}
}
<!-- Use debug=true here if you want to see output from the appender itself -->
<!-- Use line=true here if you want to see the line of code that generated this log -->
<configuration debug="true">
<!-- Use shutdownHook so that we can close gracefully and finish the log drain -->
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
<appender name="LogzioLogbackAppender" class="io.logz.logback.LogzioLogbackAppender">
<token>TOKEN_HERE</token>
<logzioType>myAwesomeType</logzioType>
<logzioUrl>https://listener-eu.logz.io:8071</logzioUrl>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender>
<root level="debug">
<!-- IMPORTANT: This line is required -->
<appender-ref ref="LogzioLogbackAppender"/>
</root>
</configuration>
Dears,
I'm trying to investigate an issue related to long log lines (due to a long stack trace caused by a stack overflow).
It seems that very long lines (exceeding the 500k limit) are truncated to ~32k and are properly indexed on logz.io. But... long lines over 50k (maybe over 32k?) and under 500k result in an invalid payload and are not properly indexed on logz.io :
I've created a minimal project to play with this limit :
LogzioTest.java
pom.xml
logback.xml
Thank you!