이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 1. JBoss LogManager and supported logging frameworks


Quarkus uses the JBoss LogManager logging backend to collect and manage log data. You can use JBoss Logging to collect data about Quarkus internal events and also about the events within your application. You can configure logging behavior in your application.properties file.

JBoss LogManager supports several third-party logging APIs in addition to the JBoss Logging. JBoss LogManager merges the logs from all the supported logging APIs.

Quarkus handles all of its logging functionalities using JBoss Logging. When you use a library that relies on a different logging API, you need to exclude this library from the dependencies and configure JBoss Logging to use a logging adapter for the third-party API.

1.1. Adding Apache Log4j logging framework

Apache Log4j is a logging framework that includes a logging backend and a logging API. Since Quarkus uses the JBoss LogManager backend, you can add the log4j2-jboss-logmanager library to your project and use Log4j as a logging API. Adding the Log4j library routes the Log4j logs to the JBoss Log Manager. You do not need to include any Log4j dependencies.

Procedure

  • Add the log4j2-jboss-logmanager library as a dependency of your project’s pom.xml file:

pom.xml

    <dependency>
      <groupId>org.jboss.logmanager</groupId>
      <artifactId>log4j2-jboss-logmanager</artifactId>
    </dependency>
Copy to Clipboard Toggle word wrap

The log4j2-jboss-logmanager is the library for the Log4J version 2 API. If you want to use the legacy Log4J version 1 API then you must add the log4j-jboss-logmanager instead.

1.2. Using logging adapters

Quarkus relies on the JBoss Logging library for all the logging requirements.

When you are using libraries that have dependencies on other logging libraries, such as Apache Commons Logging, Log4j, or SLF4j, you must exclude those logging libraries from the dependencies and use one of the adapters provided by JBoss Logging. You do not need to add an adapter for libraries that are dependencies of Quarkus extensions.

Note

The third-party logging implementation is not included in the native executable and your application might fail to compile with an error message similar to the following:

Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl
Copy to Clipboard Toggle word wrap

You can prevent this error by configuring a JBoss Logging adapter for the third-party logging implementation that you use.

Procedure

  • Depending on the logging library that you are using, add one of the adapters to your pom.xml file:

    • Apache Commons Logging:

      pom.xml

      <dependency>
          <groupId>org.jboss.logging</groupId>
          <artifactId>commons-logging-jboss-logging</artifactId>
      </dependency>
      Copy to Clipboard Toggle word wrap

    • Log4j:

      pom.xml

      <dependency>
          <groupId>org.jboss.logmanager</groupId>
          <artifactId>log4j-jboss-logmanager</artifactId>
      </dependency>
      Copy to Clipboard Toggle word wrap

    • Log4j2:

      pom.xml

      <dependency>
          <groupId>org.jboss.logmanager</groupId>
          <artifactId>log4j2-jboss-logmanager</artifactId>
      </dependency>
      Copy to Clipboard Toggle word wrap

    • SLF4j:

      pom.xml

      <dependency>
          <groupId>org.jboss.slf4j</groupId>
          <artifactId>slf4j-jboss-logmanager</artifactId>
      </dependency>
      Copy to Clipboard Toggle word wrap

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동