Search in sources :

Example 1 with JetConsoleLogHandler

use of com.hazelcast.jet.impl.util.JetConsoleLogHandler in project hazelcast by hazelcast.

the class HazelcastBootstrap method configureLogging.

public static void configureLogging() {
    if (LOGGING_CONFIGURED.compareAndSet(false, true)) {
        try {
            String loggingType = System.getProperty(LOGGING_TYPE.getName(), "jdk");
            if (loggingType.equals("jdk")) {
                java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger("");
                for (Handler handler : rootLogger.getHandlers()) {
                    if (handler instanceof ConsoleHandler) {
                        rootLogger.removeHandler(handler);
                        rootLogger.addHandler(new JetConsoleLogHandler());
                        rootLogger.setLevel(Level.INFO);
                        return;
                    }
                }
            }
        } catch (Exception e) {
            System.err.println("Error configuring java.util.logging for Hazelcast: " + e);
        }
    }
}
Also used : Handler(java.util.logging.Handler) JetConsoleLogHandler(com.hazelcast.jet.impl.util.JetConsoleLogHandler) ConsoleHandler(java.util.logging.ConsoleHandler) ConsoleHandler(java.util.logging.ConsoleHandler) TransactionException(com.hazelcast.transaction.TransactionException) JetConsoleLogHandler(com.hazelcast.jet.impl.util.JetConsoleLogHandler)

Aggregations

JetConsoleLogHandler (com.hazelcast.jet.impl.util.JetConsoleLogHandler)1 TransactionException (com.hazelcast.transaction.TransactionException)1 ConsoleHandler (java.util.logging.ConsoleHandler)1 Handler (java.util.logging.Handler)1