[logback-dev] [JIRA] Updates for LOGBACK-1654: More advanced filtering stacktrace lines

QOS.CH (JIRA) noreply-jira at qos.ch
Wed Aug 10 15:48:00 CEST 2022

logback / LOGBACK-1654 [Open]
More advanced filtering stacktrace lines


Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.

View or comment on issue using this link

 Issue created

Grzegorz Borkowski created this issue on 10/Aug/22 3:33 PM
Summary:              More advanced filtering stacktrace lines
Issue Type:           Improvement
Assignee:             Logback dev list
Created:              10/Aug/22 3:33 PM
Priority:             Major
Reporter:             Grzegorz Borkowski
  Currently, logback allows excluding some of the lines in the stacktraces from printing, which is useful for hiding stack frames coming from frameworks. E.g. 
  {{ java.lang.reflect.Method,}}
  {{ sun.reflect,}}
  {{ net.sf.cglib,}}
  {{ ByCGLIB}}
  {{ }}}
  But sometimes a bit more advanced filtering would be useful. For example, we're using javalin web framework. In recent versions they refactored their code and now the stack trace from the framework contains lots of java.util.concurrent.CompletableFuture.xxx frames. 
  If I just filter out all CompletableFuture calls, i risk hiding them also from my own code that can use CompletableFuture. This would be very confusing. 
  So i think it would be nice to be able to configure a custom "stacktracefilter" implementation that would be smart and could contain mode adanced logic. For example, it would scan the frames until it finds the first line from the framework (io.javalin.Xxx in my case) and only then starts filtering the CompletableFuture lines.
  This could look like this:
  {{ <stackTraceFrameEvaluator name="MY_EVAL" class="my.stackTraceFrameEvaluator"/>}}
  {{<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> }}
  {{ <encoder>}}
  {{ <pattern>}}
  {{ %msg%rEx\{MY_EVAL}}}
  {{ </pattern>}}
  {{ </encoder>}}
  {{ </appender>}}

 This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)

More information about the logback-dev mailing list