{"record":{"id":"c363ac4dc2e1b4c9","repo":"oracle/graal","slug":"invalid-log-level-s-specified-s","errorCode":null,"errorMessage":"Invalid log level %s specified. %s'","messagePattern":"Invalid log level (.+?) specified\\. (.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccessBuilder.java","lineNumber":199,"sourceCode":"            key = vmOption.substring(0, eqIdx);\n            value = vmOption.substring(eqIdx + 1);\n        }\n\n        if (value == null) {\n            value = \"true\";\n        }\n        int index = key.indexOf('.');\n        String group = key;\n        if (index >= 0) {\n            group = group.substring(0, index);\n        }\n        if (\"log\".equals(group)) {\n            if (key.endsWith(\".level\")) {\n                try {\n                    Level.parse(value);\n                    builder.option(key, value);\n                } catch (IllegalArgumentException e) {\n                    throw new IllegalArgumentException(String.format(\"Invalid log level %s specified. %s'\", vmOption, e.getMessage()));\n                }\n                return;\n            } else if (\"log.file\".equals(key)) {\n                OutputStream out;\n                try {\n                    out = new BufferedOutputStream(Files.newOutputStream(Paths.get(value), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.APPEND));\n                } catch (IOException e) {\n                    throw new IllegalArgumentException(\"Cannot use the specified log.file\", e);\n                }\n                builder.logHandler(out);\n                return;\n            }\n        }\n        OptionDescriptor descriptor = findOptionDescriptor(group, key);\n        if (descriptor == null) {\n            key = JAVA_LANGUAGE_ID + \".\" + key;\n            descriptor = findOptionDescriptor(JAVA_LANGUAGE_ID, key);\n            if (descriptor == null) {","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccessBuilder.java#L181-L217","documentation":"Thrown by EspressoExternalVMAccessBuilder while parsing a 'log.<name>.level' VM option (e.g. -Djava.log.espresso.level=...). The value must be parseable by java.util.logging.Level.parse; anything else is rejected with IllegalArgumentException before the option reaches the engine.","triggerScenarios":"Passing a builder option like \"java.log.<category>.level\" whose value is not a valid java.util.logging level: misspelled names (e.g. 'WARN' instead of 'WARNING'), log4j/slf4j level names ('TRACE', 'DEBUG', 'ERROR'), or a non-numeric garbage string.","commonSituations":"Copying log level names from log4j2/slf4j configuration into Espresso VM options; using 'VERBOSE' which is not a JUL level; copy-paste of option values between -H: logging flags (HotSpot style) and Espresso's java.* options.","solutions":["Use a valid java.util.logging.Level value: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL, or an integer like '700'","If you need TRACE/DEBUG-style granularity, map it to FINEST/FINE instead of passing the log4j name verbatim","Verify the value with Level.parse(value) in your own option handling before handing it to the builder"],"exampleFix":"// before\nbuilder.option(\"java.log.espresso.level\", \"DEBUG\"); // not a JUL level\n\n// after\nbuilder.option(\"java.log.espresso.level\", \"FINE\"); // valid java.util.logging level","handlingStrategy":"validation","validationCode":"try { java.util.logging.Level.parse(value); }\ncatch (IllegalArgumentException e) { throw new IllegalArgumentException(\"Not a JUL level: \" + value, e); }\nbuilder.option(\"java.log.<cat>.level\", value);","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { log warning and fall back to \"INFO\" or fail fast on config }","preventionTips":["Whitelist the nine JUL level names plus integers in config schemas","Map log4j/slf4j level names (TRACE->FINEST, DEBUG->FINE, ERROR->SEVERE) at your config boundary"],"tags":["espresso","configuration","logging","vm-options"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}