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.
Recommended Articles
Optimize WildFly Java Applications with Async Handler for High-Performance Logging
Maximize your WildFly Java applications' performance by leveraging the Async Handler for efficient logging. Learn how to decouple I/O operations and improve thread utilization.
Mastering Simple Logging Facade (SLF4J) in Java: A Comprehensive Guide
Learn how SLF4J simplifies Java logging and enhances flexibility. #Java #Logging #Middleware
Enhance Your Enterprise Java Applications with Custom Logging Profiles - WildFly 26
Learn how to define custom logging profiles in WildFly 26 for improved application performance and security.
Mastering Logging, Tracing, and Metrics in Enterprise Java Applications
Enhance your enterprise Java applications with robust monitoring through logging, tracing, and metrics. Learn the essentials of each component.