Class ThrowableConsumingMessageFactory

java.lang.Object
org.apache.logging.slf4j.message.ThrowableConsumingMessageFactory
All Implemented Interfaces:
MessageFactory, MessageFactory2

public final class ThrowableConsumingMessageFactory extends Object implements MessageFactory2
A message factory that eagerly removes a trailing throwable argument.

This factory implements the algorithm used by Logback 1.1.x or later to determine Message.getThrowable(): if the last argument is a Throwable and there are less arguments than the number of placeholders incremented by one, the last argument will be used as Message.getThrowable() and will not appear in the parameterized message.

The usual Log4j semantic only looks for throwables once all the placeholders have been filled.

Since:
2.24.0
  • Constructor Details

    • ThrowableConsumingMessageFactory

      public ThrowableConsumingMessageFactory()
  • Method Details