{"record":{"id":"f4cd9d3abf86a73e","repo":"apache/maven","slug":"loglevelthreshold-is-not-a-valid-log-severity-t","errorCode":null,"errorMessage":"${logLevelThreshold} is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.","messagePattern":"(.+?) is not a valid log severity threshold\\. Valid severities are WARN/WARNING and ERROR\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java","lineNumber":453,"sourceCode":"        }\n    }\n\n    protected void activateLogging(C context) throws Exception {\n        if (!SLF4JBridgeHandler.isInstalled()) {\n            SLF4JBridgeHandler.removeHandlersForRootLogger();\n            SLF4JBridgeHandler.install();\n        }\n\n        context.slf4jConfiguration.activate();\n        if (context.options().failOnSeverity().isPresent()) {\n            String logLevelThreshold = context.options().failOnSeverity().get();\n            if (context.loggerFactory instanceof LogLevelRecorder recorder) {\n                LogLevelRecorder.Level level =\n                        switch (logLevelThreshold.toLowerCase(Locale.ENGLISH)) {\n                            case \"warn\", \"warning\" -> LogLevelRecorder.Level.WARN;\n                            case \"error\" -> LogLevelRecorder.Level.ERROR;\n                            default ->\n                                throw new IllegalArgumentException(\n                                        logLevelThreshold\n                                                + \" is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.\");\n                        };\n                recorder.setMaxLevelAllowed(level);\n                context.logger.info(\"Enabled to break the build on log level \" + logLevelThreshold + \".\");\n            } else {\n                context.logger.warn(\"Expected LoggerFactory to be of type '\" + LogLevelRecorder.class.getName()\n                        + \"', but found '\"\n                        + context.loggerFactory.getClass().getName() + \"' instead. \"\n                        + \"The --fail-on-severity flag will not take effect.\");\n            }\n        }\n\n        // at this point logging is set up, reply so far accumulated logs, if any and swap logger with real one\n        Logger logger =\n                new Slf4jLogger(context.loggerFactory.getLogger(getClass().getName()));\n        context.logger.drain().forEach(e -> logger.log(e.level(), e.message(), e.error()));\n        context.logger = logger;","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java#L435-L471","documentation":"Error \"${logLevelThreshold} is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java:453 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}