diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java index 3fd7f1c3e1220..b734842a281a4 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java @@ -248,16 +248,28 @@ private static Map createNamedHandlers(LogConfig config, List filterElements) { Map namedHandlers = new HashMap<>(); for (Entry consoleConfigEntry : config.consoleHandlers.entrySet()) { - final Handler consoleHandler = configureConsoleHandler(consoleConfigEntry.getValue(), errorManager, filterElements, + ConsoleConfig namedConsoleConfig = consoleConfigEntry.getValue(); + if (!namedConsoleConfig.enable) { + continue; + } + final Handler consoleHandler = configureConsoleHandler(namedConsoleConfig, errorManager, filterElements, possibleFormatters, null); addToNamedHandlers(namedHandlers, consoleHandler, consoleConfigEntry.getKey()); } for (Entry fileConfigEntry : config.fileHandlers.entrySet()) { - final Handler fileHandler = configureFileHandler(fileConfigEntry.getValue(), errorManager, filterElements); + FileConfig namedFileConfig = fileConfigEntry.getValue(); + if (!namedFileConfig.enable) { + continue; + } + final Handler fileHandler = configureFileHandler(namedFileConfig, errorManager, filterElements); addToNamedHandlers(namedHandlers, fileHandler, fileConfigEntry.getKey()); } for (Entry sysLogConfigEntry : config.syslogHandlers.entrySet()) { - final Handler syslogHandler = configureSyslogHandler(sysLogConfigEntry.getValue(), errorManager, filterElements); + SyslogConfig namedSyslogConfig = sysLogConfigEntry.getValue(); + if (!namedSyslogConfig.enable) { + continue; + } + final Handler syslogHandler = configureSyslogHandler(namedSyslogConfig, errorManager, filterElements); if (syslogHandler != null) { addToNamedHandlers(namedHandlers, syslogHandler, sysLogConfigEntry.getKey()); }