How to replace MarkerIgnoringBase in SLF4J

413 Views Asked by At

There is some old code that we have in our code base which extended MarkerIgnoringBase. Since we are in the process of migrating, I added the dependency in maven of 2.0.0-alpha1.

But the class MarkerIgnoringBase, I see has been deprecated. Just wanted to know that is there any direct alternatives to this class, if not direct or at least something remotely similar that I can use. I tried some of its sub-classes, but they seem to be completely different.

Also there is very little documentation that I can find saying this has been deprecated and what to use instead.

1

There are 1 best solutions below

1
On

As per the following link, this class serves as base for adapters or native implementations of logging systems lacking Marker support. It is an abstract class which has the following implementations.

  • JDK14LoggerAdapter
  • Log4jLoggerAdapter
  • NOPLogger
  • SimpleLogger

So basically it is an adapter.You can use logback along with Slf4j.

http://www.slf4j.org/api/org/slf4j/helpers/MarkerIgnoringBase.html

http://www.slf4j.org/api/org/slf4j/helpers/class-use/MarkerIgnoringBase.html