{"record":{"id":"5158b06a32e3fbb1","repo":"quarkusio/quarkus","slug":"improper-integration-of-logfilterfactory-class","errorCode":null,"errorMessage":"Improper integration of '${LogFilterFactory.class.getName()}' detected","messagePattern":"Improper integration of '(.+?)' detected","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/logging/ArcLogFilterFactory.java","lineNumber":20,"sourceCode":"\nimport java.util.logging.Filter;\n\nimport io.quarkus.arc.Arc;\nimport io.quarkus.arc.InstanceHandle;\nimport io.quarkus.runtime.logging.LogFilterFactory;\n\n/**\n * Creates the implementation of the class by getting a bean from Arc.\n * This class is loaded automatically by the {@link java.util.ServiceLoader}.\n */\npublic class ArcLogFilterFactory implements LogFilterFactory {\n\n    @Override\n    public Filter create(String className) throws Exception {\n        InstanceHandle<?> instance = Arc.requireContainer().instance(Class.forName(className, true, Thread.currentThread()\n                .getContextClassLoader()));\n        if (!instance.isAvailable()) {\n            throw new IllegalStateException(\"Improper integration of '\" + LogFilterFactory.class.getName() + \"' detected\");\n        }\n        return (Filter) instance.get();\n    }\n\n    @Override\n    public int priority() {\n        return LogFilterFactory.DEFAULT_PRIORITY - 100;\n    }\n}\n","sourceCodeStart":2,"sourceCodeEnd":30,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/logging/ArcLogFilterFactory.java#L2-L30","documentation":"ArcLogFilterFactory.create loads the named filter class and looks it up in the ArC container; if the container has no bean instance available for that class, it concludes the logging-filter-to-CDI integration was done incorrectly and throws this IllegalStateException. A @LogFilter class must be a discoverable CDI bean managed by ArC.","triggerScenarios":"Registering a log filter class name via the LogFilterFactory mechanism where the target class is not a CDI bean in the ArC container (not annotated/discovered as a bean, excluded via build item, or in a non-bean archive).","commonSituations":"Filter class placed in a package excluded from bean discovery; missing bean-defining annotation; class present but removed from the container by build-time exclusion; wrong class name string passed to create().","solutions":["Annotate the filter class with a bean-defining annotation (e.g. @ApplicationScoped) so ArC turns it into a bean","Verify the class name passed to create() matches the filter class exactly","Ensure the class is not excluded from bean discovery (no beans.xml/exclusion filters removing it)","Rebuild the application so the container indexes the filter class"],"exampleFix":"// before\npublic class MyLogFilter implements Filter { ... }\n// after\n@ApplicationScoped\npublic class MyLogFilter implements Filter { ... }","handlingStrategy":"validation","validationCode":"Class<?> filterClass = Class.forName(className, true, tccl);\nboolean isBean = Arc.container() != null\n        && Arc.container().instance(filterClass).isAvailable();\nif (!isBean) throw new IllegalStateException(className + \" is not a CDI bean; add a bean-defining annotation\");","typeGuard":null,"tryCatchPattern":"try {\n    Filter f = factory.create(className);\n} catch (IllegalStateException e) {\n    logger.error(\"Make the log filter a discoverable CDI bean (@ApplicationScoped)\", e);\n}","preventionTips":["Annotate every log filter class with a bean-defining annotation","Verify bean discovery is not excluding the filter's package","Test that Arc.container().instance(FilterClass).isAvailable() is true at startup"],"tags":["quarkus","arc","cdi","logging","bean-discovery"],"backgroundTag":"cdi-bean-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}