spring boot - Include context line above and below the common frames after ommitting - Stack Overflow

admin2025-04-17  2

I want to exclude common frames from my throwable logs. Instead of exclude all frames for a regex match I want to still keep 2 lines from above and below the common frame for context purpose. I have implemented my own ConsoleAppender by extending it and using LogstashEncoder(logstash-logback-encoder:8.0) inside it.

In ShortenedThrowableConverter only

public String convert(ILoggingEvent event)

can be overriden, but it includes the code to add caused append root cause first/last, i would have to rewrite that logic.

Is there a way to do what I am expecting .

转载请注明原文地址:http://anycun.com/QandA/1744878101a88900.html