LogbackKafkaFilter.java

  1. package no.nav.data.common.kafka;

  2. import ch.qos.logback.classic.spi.ILoggingEvent;
  3. import ch.qos.logback.core.filter.Filter;
  4. import ch.qos.logback.core.spi.FilterReply;

  5. public class LogbackKafkaFilter extends Filter<ILoggingEvent> {

  6.     @Override
  7.     public FilterReply decide(ILoggingEvent event) {
  8.         var msg = event.getFormattedMessage();
  9.         if ("The configuration 'specific.avro.reader' was supplied but isn't a known config.".equals(msg) ||
  10.                 "The configuration 'schema.registry.url' was supplied but isn't a known config.".equals(msg)) {
  11.             return FilterReply.DENY;
  12.         }
  13.         return FilterReply.NEUTRAL;
  14.     }
  15. }