Can java.util.logging style logging.properties be loaded on JBoss EAP 7?

Solution Unverified - Updated -

Issue

We are trying to use 3rd party library with the following java.util.logging(JUL) style property file that works on non-jboss environment. However, logging.properties is not loaded properly.

import java.io.IOException;
import java.io.InputStream;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class LoggingConfigurationListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        try (InputStream is = LogUtils.class.getClassLoader().getResourceAsStream("logging.properties")) {
            LogManager logManager = LogManager.getLogManager();
            logManager.readConfiguration(is);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {}
}

Our logging.properties is JUL style property as follows:

handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
.level = INFO

java.util.logging.FileHandler.pattern = /opt/jboss-eap-7.4/standalone/log/util.log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = INFO
java.util.logging.FileHandler.append = true
java.util.logging.FileHandler.encoding = UTF-8

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8

We can see the following message in stdout, when java.util.logging.LogManager#readConfiguration(InputStream is) is called:

Handler java.util.logging.FileHandler is not defined
Handler java.util.logging.ConsoleHandler is not defined

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content