Solving “Handler java.util.logging.ConsoleHandler is not defined” on Wildlfy

This article will explain how to solve the issue “Handler java.util.logging.ConsoleHandler is not defined” when deploying a Spring Boot Web application on WildFly.

The issue

This issue has been reported when deploying a Spring Boot Web application in a WIldFly application server:

Handler java.util.logging.ConsoleHandler is not defined 

As discussed in detail in this tutorial: How to run Spring Boot applications on WildFly , we need to remove the logback-classic library in order to have the Spring Boot starter Web working on WildFly:

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
</dependency>

Fixing the issue

You can fix this issue in two ways:

Option 1: Add in Spring Boot resources/application.properties the following:

logging.level.root=info

Option 2: Set the property org.springframework.boot.logging.LoggingSystem to “none” in your WildFly configuration

/system-property=org.springframework.boot.logging.LoggingSystem:add(value=none)

Both options will work to solve the issue “Handler java.util.logging.ConsoleHandler is not defined” when deploying a Spring Boot Web application on WildFly.

Found the article helpful? if so please follow us on Socials