{"record":{"id":"142bcd599a8b171d","repo":"quarkusio/quarkus","slug":"unimplemented-mode-of-use-of-io-quarkus-runtime-l","errorCode":null,"errorMessage":"Unimplemented mode of use of 'io.quarkus.runtime.logging.LoggingFilter'","messagePattern":"Unimplemented mode of use of 'io\\.quarkus\\.runtime\\.logging\\.LoggingFilter'","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java","lineNumber":361,"sourceCode":"            ConsoleRuntimeConfig consoleRuntimeConfig = config.getConfigMapping(ConsoleRuntimeConfig.class);\n\n            initializeBuildTimeLogging(logRuntimeConfigInBuild, logBuildTimeConfig, consoleRuntimeConfig,\n                    categoryMinLevelDefaults.content, additionalLogCleanupFilters, launchModeBuildItem.getLaunchMode());\n            // Build time logging is terminated before the application is started, after dev services are started.\n            // When there is no devservices build time logging is still closed at deployment classloader close #closeBuildTimeLogging\n        }\n        return new LoggingSetupBuildItem();\n    }\n\n    private DiscoveredLogComponents discoverLogComponents(IndexView index) {\n        Collection<AnnotationInstance> loggingFilterInstances = index.getAnnotations(LOGGING_FILTER);\n        DiscoveredLogComponents result = new DiscoveredLogComponents();\n\n        Map<String, String> filtersMap = new HashMap<>();\n        for (AnnotationInstance instance : loggingFilterInstances) {\n            AnnotationTarget target = instance.target();\n            if (target.kind() != AnnotationTarget.Kind.CLASS) {\n                throw new IllegalStateException(\"Unimplemented mode of use of '\" + LoggingFilter.class.getName() + \"'\");\n            }\n            ClassInfo classInfo = target.asClass();\n            boolean isFilterImpl = false;\n            ClassInfo currentClassInfo = classInfo;\n            while ((currentClassInfo != null) && (!JandexUtil.DOTNAME_OBJECT.equals(currentClassInfo.name()))) {\n                boolean hasFilterInterface = false;\n                List<DotName> ifaces = currentClassInfo.interfaceNames();\n                for (DotName iface : ifaces) {\n                    if (FILTER.equals(iface)) {\n                        hasFilterInterface = true;\n                        break;\n                    }\n                }\n                if (hasFilterInterface) {\n                    isFilterImpl = true;\n                    break;\n                }\n                currentClassInfo = index.getClassByName(currentClassInfo.superName());","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java#L343-L379","documentation":"LoggingResourceProcessor.discoverLogComponents throws this IllegalStateException during the build when a @LoggingFilter annotation is placed on a target that is not a class (e.g. a method, field, or parameter). Only classes can be processed as log filter components, so any other annotation target is an unimplemented/unsupported use.","triggerScenarios":"Annotating a method, field, or parameter with @io.quarkus.runtime.logging.LoggingFilter instead of a class implementing java.util.logging.Filter; the build step iterates indexed @LoggingFilter instances and rejects non-CLASS targets.","commonSituations":"Copy-pasting the annotation onto a filter method rather than a filter class; misunderstanding that @LoggingFilter must decorate a java.util.logging.Filter implementation.","solutions":["Move the @LoggingFilter annotation onto a public class that implements java.util.logging.Filter.","Ensure the class has a no-arg constructor and a 'name' attribute set on the annotation.","Rebuild the application after fixing the annotation placement."],"exampleFix":"// before\nclass MyFilterUtil {\n    @LoggingFilter(name = \"my-filter\")\n    boolean isLoggable(LogRecord r) { return false; }\n}\n// after\n@LoggingFilter(name = \"my-filter\")\npublic class MyFilter implements java.util.logging.Filter {\n    @Override\n    public boolean isLoggable(LogRecord record) { return false; }\n}","handlingStrategy":"validation","validationCode":"Class<?> c = MyClass.class;\nif (!c.isAnnotationPresent(LoggingFilter.class)) return;\nif (!java.util.logging.Filter.class.isAssignableFrom(c)) {\n    throw new IllegalStateException(\"@LoggingFilter must be on a java.util.logging.Filter implementation: \" + c);\n}","typeGuard":"static boolean isValidLoggingFilter(Class<?> c) {\n    return c.isAnnotationPresent(LoggingFilter.class)\n        && java.util.logging.Filter.class.isAssignableFrom(c);\n}","tryCatchPattern":null,"preventionTips":["Only annotate classes, never methods or fields, with @LoggingFilter.","Always implement java.util.logging.Filter in the annotated class.","Keep the annotation and the interface import together in code templates."],"tags":["quarkus","build-time","logging","annotation-misuse"],"backgroundTag":"unsupported-annotation-target","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}