Lets have an Exception stacktrace with multiple 'caused by' sections:
my.Exception1: Bad luck
at ...
Caused by: my.Exception2
at ...
Caused by: my.Exception3
at ...
Caused by: my.Exception4
at ...
each caused by section can span multiple lines. There is a JVM parameter
-XX:MaxJavaStackTraceDepth
but this affects the stacktrace as a whole - it will cut everything below for example Exception3 (the inner most Exception will be out). I would like to keep every 'caused by' section, but limit each part to for example 20 lines. One possible solution I'm aware of is ThrowableRenderer from log4j. Is there something else? The goal is to preserve as much useful information from stacktraces as possible in an limited environment (maximum size in bytes for one log entry).