2

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.

hell_storm2004
  • 1,401
  • 2
  • 33
  • 66
  • In which version the class was dropped? In `2.0.0-alpha1` it is still available as far as I can see (https://github.com/qos-ch/slf4j/blob/v_2.0.0-alpha1/slf4j-api/src/main/java/org/slf4j/helpers/MarkerIgnoringBase.java) – TobiSH Nov 01 '19 at 07:03
  • Can you show the code of the class which extends `MarkerIgnoringBase`? – TobiSH Nov 01 '19 at 07:06
  • You can see @deprecated annotation right at the start, one or two lines above the class declaration. – hell_storm2004 Nov 01 '19 at 07:10
  • Yes I saw this. You mentioned that the class has been dropped (maybe I just misinterpreted this as "deleted"). – TobiSH Nov 01 '19 at 07:13
  • Ah sorry. I probably should have been more specific on that part! Also I cant really say when it was dropped. The version we were using dates back to the recession times! And it lies in a largely untouched part of the code, now that we are migrating, all of these archaic stuff are popping up left right and center. – hell_storm2004 Nov 01 '19 at 07:14

1 Answers1

0

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

Sambit
  • 7,625
  • 7
  • 34
  • 65
  • Nope. None of these are a replacement for my needs. The first two are final classes. So they are out of the question of extending. The two NOPLoggers mentioned in the javadoc, have their methods turned off (final). And SimpleLogger doesn't have a constructor. Weird!!!! Its a deprecated class, but still all these extend it and there is not other flexible option available. I probably have to stick to the old class for now, and hope someone provides an alternative in the future. – hell_storm2004 Nov 01 '19 at 08:20