SLF4J extension for NoException

NoException » Extensions » SLF4J

This extension of NoException library adds exception handlers that log all exceptions to SLF4J loggers.


Get this extension from Maven Central:


Or clone sources from GitHub or Bitbucket. Don't forget to configure your build for Java 11+. Sources and binaries are distributed under Apache License 2.0.

If your project is a Java module, add the following declaration to your

requires com.machinezoo.noexception.slf4j;


Class ExceptionLogging provides the following exception handlers:


Typical usage is to catch all exceptions and log them:

    ExceptionLogging.log().get(() -> "test".substring(5)).orElse("fallback"));

See NoException tutorial for other ways to use the handlers.

Next steps