quarkusio/quarkus · error · IllegalStateException
Unable to derive the logger name at ${injectionPoint}
Error message
Unable to derive the logger name at ${injectionPoint} What it means
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.
Source
Thrown at extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/LoggerProducer.java:42
@Produces
@DefaultBean
Logger getSimpleLogger(InjectionPoint injectionPoint) {
return loggers.computeIfAbsent(injectionPoint.getMember().getDeclaringClass().getName(), Logger::getLogger);
}
@LoggerName("")
@Dependent
@Produces
@DefaultBean
Logger getLoggerWithCustomName(InjectionPoint injectionPoint) {
String name = null;
for (Annotation qualifier : injectionPoint.getQualifiers()) {
if (qualifier.annotationType().equals(LoggerName.class)) {
name = ((LoggerName) qualifier).value();
}
}
if (name == null || name.isEmpty()) {
throw new IllegalStateException("Unable to derive the logger name at " + injectionPoint);
}
return loggers.computeIfAbsent(name, Logger::getLogger);
}
@PreDestroy
void destroy() {
loggers.clear();
}
}
View on GitHub (pinned to e1c734241f)
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
Example fix
// before
@Inject
Logger log;
// after
@Inject
@LoggerName("com.example.MyService")
Logger log; Defensive patterns
Strategy: validation
Validate before calling
LoggerField f = ...;
boolean hasLoggerName = f.getAnnotationsByType(LoggerName.class).length > 0
&& !f.getAnnotation(LoggerName.class).value().isBlank();
if (!hasLoggerName) throw new DeploymentException("Logger injection point needs @LoggerName: " + f); Try / catch
try {
Logger log = producer.getLoggerWithCustomName(ip);
} catch (IllegalStateException e) {
logger.error("Add @LoggerName to the injection point", e);
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Improper integration of '${LogFilterFactory.class.getName()}
- Quarkus does not support CDI Full @Specializes annotation; t
- IllegalStateException wrapping ClassNotFoundException for ge
- Injected @Decorated Bean<> has to use the delegate type as i
- Unable to construct type for ${btRemovedBean}: ${e.getMessag
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/8131cd870b23b533.
Report an issue: GitHub.