{"record":{"id":"8131cd870b23b533","repo":"quarkusio/quarkus","slug":"unable-to-derive-the-logger-name-at-injectionpoi","errorCode":null,"errorMessage":"Unable to derive the logger name at ${injectionPoint}","messagePattern":"Unable to derive the logger name at (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/LoggerProducer.java","lineNumber":42,"sourceCode":"    @Produces\n    @DefaultBean\n    Logger getSimpleLogger(InjectionPoint injectionPoint) {\n        return loggers.computeIfAbsent(injectionPoint.getMember().getDeclaringClass().getName(), Logger::getLogger);\n    }\n\n    @LoggerName(\"\")\n    @Dependent\n    @Produces\n    @DefaultBean\n    Logger getLoggerWithCustomName(InjectionPoint injectionPoint) {\n        String name = null;\n        for (Annotation qualifier : injectionPoint.getQualifiers()) {\n            if (qualifier.annotationType().equals(LoggerName.class)) {\n                name = ((LoggerName) qualifier).value();\n            }\n        }\n        if (name == null || name.isEmpty()) {\n            throw new IllegalStateException(\"Unable to derive the logger name at \" + injectionPoint);\n        }\n        return loggers.computeIfAbsent(name, Logger::getLogger);\n    }\n\n    @PreDestroy\n    void destroy() {\n        loggers.clear();\n    }\n\n}\n","sourceCodeStart":24,"sourceCodeEnd":53,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/LoggerProducer.java#L24-L53","documentation":"LoggerProducer throws this IllegalStateException when a @Logger injection point has no @LoggerName qualifier (or its value is empty), so the producer cannot derive the logger name. The producer must know a name to create the JBoss Logging Logger. The injection point itself is included in the message to help locate the offending field.","triggerScenarios":"Injecting a Logger without a @LoggerName(\"...\") qualifier while only the name-derived producer is active, or using @LoggerName(\"\") / @LoggerName with a blank value at an injection point.","commonSituations":"Migrating code that previously used a default logger producer (e.g. named after the class) into a configuration requiring explicit @LoggerName; copy-paste removing the qualifier; typos leaving the qualifier value empty.","solutions":["Add @LoggerName(\"your.logger.name\") to the Logger injection point","If you want a class-derived name, inject via a producer/qualification mechanism that derives the name from the injection point class (e.g. LoggerProducer without custom-name requirement)","Rebuild and confirm only one producer method applies to your injection point"],"exampleFix":"// before\n@Inject\nLogger log;\n// after\n@Inject\n@LoggerName(\"com.example.MyService\")\nLogger log;","handlingStrategy":"validation","validationCode":"LoggerField f = ...;\nboolean hasLoggerName = f.getAnnotationsByType(LoggerName.class).length > 0\n        && !f.getAnnotation(LoggerName.class).value().isBlank();\nif (!hasLoggerName) throw new DeploymentException(\"Logger injection point needs @LoggerName: \" + f);","typeGuard":null,"tryCatchPattern":"try {\n    Logger log = producer.getLoggerWithCustomName(ip);\n} catch (IllegalStateException e) {\n    logger.error(\"Add @LoggerName to the injection point\", e);\n}","preventionTips":["Always annotate Logger injection points with @LoggerName and a non-empty value","Use build-time checks/tests that scan for unqualified Logger injections","Never pass an empty string to @LoggerName"],"tags":["quarkus","arc","cdi","logging","injection-point"],"backgroundTag":"missing-annotation-qualifier","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"}