{"record":{"id":"46001df1b441e79a","repo":"quarkusio/quarkus","slug":"unable-to-create-instance-of-logging-filter","errorCode":null,"errorMessage":"Unable to create instance of Logging Filter ''","messagePattern":"Unable to create instance of Logging Filter ''","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java","lineNumber":310,"sourceCode":"        InitialConfigurator.DELAYED_HANDLER.setAutoFlush(false);\n        InitialConfigurator.DELAYED_HANDLER.setHandlers(handlers.toArray(LogContextInitializer.NO_HANDLERS));\n        return shutdownNotifier;\n    }\n\n    private static Map<String, Filter> createNamedFilters(DiscoveredLogComponents discoveredLogComponents) {\n        if (discoveredLogComponents.getNameToFilterClass().isEmpty()) {\n            return emptyMap();\n        }\n\n        Map<String, Filter> nameToFilter = new HashMap<>();\n        LogFilterFactory logFilterFactory = LogFilterFactory.load();\n        discoveredLogComponents.getNameToFilterClass().forEach(new BiConsumer<>() {\n            @Override\n            public void accept(String name, String className) {\n                try {\n                    nameToFilter.put(name, logFilterFactory.create(className));\n                } catch (Exception e) {\n                    throw new RuntimeException(\"Unable to create instance of Logging Filter '\" + className + \"'\", e);\n                }\n            }\n        });\n        return nameToFilter;\n    }\n\n    /**\n     * WARNING: this method is part of the recorder but is actually called statically at build time.\n     * You may not push RuntimeValue's to it.\n     */\n    public static void initializeBuildTimeLogging(\n            final LogRuntimeConfig config,\n            final LogBuildTimeConfig buildConfig,\n            final ConsoleRuntimeConfig consoleConfig,\n            final Map<String, InheritableLevel> categoryDefaultMinLevels,\n            final List<LogCleanupFilterElement> additionalLogCleanupFilters,\n            final LaunchMode launchMode) {\n","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java#L292-L328","documentation":"LoggingSetupRecorder maps each discovered custom log component name to its filter class by instantiating the class via a LogFilterFactory; any exception during instantiation is wrapped in a RuntimeException \"Unable to create instance of Logging Filter '<className>'\". It means the configured filter/logger class could not be constructed during logging setup.","triggerScenarios":"quarkus.log.filter or log component configuration naming a filter class that is missing, has no no-arg constructor, throws in its constructor, or is not visible to the classloader at logging setup time.","commonSituations":"Typo in filter class name in application.properties; filter class removed/refactored after config was written; filter throwing in constructor due to bad config; class in a module not on the runtime classpath.","solutions":["Fix the configured class name in application.properties so it matches an existing filter class on the classpath","Ensure the filter class has a public no-arg constructor and does not throw during construction","Add the module/JAR containing the filter class to the application dependencies","Check the caused-by exception in the stack trace for the underlying reason"],"exampleFix":"// before (application.properties)\nquarkus.log.filter.myfilter=com.example.OldFilter\n// after\nquarkus.log.filter.myfilter=com.example.MyLogFilter","handlingStrategy":"validation","validationCode":"// before configuring a filter class, verify it instantiates\nClass<?> c = Class.forName(\"com.example.MyLogFilter\");\nObject f = c.getDeclaredConstructor().newInstance(); // must not throw","typeGuard":null,"tryCatchPattern":"try { startLogging(); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Unable to create instance of Logging Filter\")) log.error(\"Fix quarkus.log.filter class name/constructor\", e.getCause()); else throw e; }","preventionTips":["Keep filter class names in application.properties in sync with code refactors","Give custom filters public no-arg constructors","Keep logging-filter modules on the runtime classpath"],"tags":["logging","configuration","reflection"],"backgroundTag":"class-instantiation-failed","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"}