diff --git a/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java index 5e0259026cafb..4bc1ee15c7e94 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java @@ -612,10 +612,23 @@ private static BiFunction generate } private static ResultHandle getLogManagerLevelIntValue(String levelName, BytecodeCreator method) { - final ResultHandle infoLevel = method.readStaticField( - FieldDescriptor.of(org.jboss.logmanager.Level.class, levelName, org.jboss.logmanager.Level.class)); + FieldDescriptor fd; + switch (levelName) { + case "FATAL": + case "ERROR": + case "WARN": + case "INFO": + case "DEBUG": + case "TRACE": + fd = FieldDescriptor.of(org.jboss.logmanager.Level.class, levelName, org.jboss.logmanager.Level.class); + break; + default: + fd = FieldDescriptor.of(Level.class, levelName, Level.class); + break; + } + final ResultHandle levelVal = method.readStaticField(fd); return method - .invokeVirtualMethod(MethodDescriptor.ofMethod(Level.class, "intValue", int.class), infoLevel); + .invokeVirtualMethod(MethodDescriptor.ofMethod(Level.class, "intValue", int.class), levelVal); } private static void generateDefaultLoggingLogger(Level minLevel, ClassOutput output) {