I don't think, I'm the first one who wants this, but I cannot find a configuration for it.
A typical logback log output looks as follows:
2021-01-07 13:26:04,639 [MyThread] ERROR [] one.of.my.Classes - Some nice error message : java.lang.RuntimeException
java.lang.RuntimeException: null
at one.of.my.Classes.method0(Classes:123)
at one.of.my.Classes.method2(Classes:33)
...
Caused by: foo.bar.AnotherException: Blah
at one.of.my.other.Clazz(Foo.java:693)
...
2021-01-07 13:26:04,639 [MyThread] INFO [] one.of.my.Classes - Multi line info message
Second line
Third line
2021-01-07 13:26:04,639 [MyThread] INFO [] Some other output
To make the output easier to read and also easier to process by log parsers, I'd like to add indentation for lines, which belong to another line, for example:
2021-01-07 13:26:04,639 [MyThread] ERROR [] one.of.my.Classes - Some nice error message : java.lang.RuntimeException
java.lang.RuntimeException: null
at one.of.my.Classes.method0(Classes:123)
at one.of.my.Classes.method2(Classes:33)
...
Caused by: foo.bar.AnotherException: Blah
at one.of.my.other.Clazz(Foo.java:693)
...
2021-01-07 13:26:04,639 [MyThread] INFO [] one.of.my.Classes - Multi line info message
Second line
Third line
2021-01-07 13:26:04,639 [MyThread] INFO [] Some other output
So, how can I achieve this with logback?