2

I was surprised there's no generic log function for logback, in the same way as for java.util.logging. I have following legacy code using java.util.logging:

logger.log(logLevelOfChoice, "log message");

How to properly port it to logback?

alebo611
  • 1,112
  • 1
  • 9
  • 16
  • Possible duplicate of [how to map levels of java.util.logging and slf4j logger?](https://stackoverflow.com/questions/20795373/how-to-map-levels-of-java-util-logging-and-slf4j-logger) – jmehrens Dec 29 '17 at 14:35

1 Answers1

1

There is no one method that is equivalent. You have to call each of the individual methods that map to the right level.

jmehrens
  • 10,580
  • 1
  • 38
  • 47