Lambda support for SLF4J API

Souvik picture Souvik · Dec 21, 2016 · Viewed 11.8k times · Source

In Log4j latest API we have Lambda support where I can manage the Debug option easily.

Example:

logger.debug("This {} and {} with {} ", 
  () -> this, () -> that, () -> compute());

But for slf4j/logback is there any option to have lambda enabled as mentioned above. Please let me know the syntax then.

Answer

Mariano Ruiz picture Mariano Ruiz · Apr 28, 2017

Unfortunately, this is not supported yet: https://jira.qos.ch/browse/SLF4J-371