tapir uses Log4j2 as logging framework.


tapir does not recommend any configuration style. You can configure Log4j2 the way you prefer. Just take a look at https://logging.apache.org/log4j/2.x/manual/configuration.html.

Anyway, if you prefer using a xml file this one is a good starting point. It is generated by our archetype as well:


<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
        <Root level="info">
            <AppenderRef ref="Console" />

What about third-party libraries?

tapir uses bridges to redirect the logging output of logging frameworks which are used by third-party libraries to Log4j2. That has the advantage that you can configure all loggers with a Log4j2 configuration.

We analyzed the logging frameworks which our third-party libraries used and included the corresponding bridges in the tapir-depenencies module. If you add additional frameworks with additional logging frameworks you have to add the bridge by yourself.

The following logging frameworks are bridged out-of-the-box:

Due to http://logging.apache.org/log4j/2.x/log4j-1.2-api/index.html we have to exclude the Log4j 1.x jars
  • SLF4J
  • Apache Commons Logging
  • java.util.logging (JUL)