projectlombok/lombok · error · IllegalArgumentException
No logger factory method parameters specified.
Error message
No logger factory method parameters specified.
What it means
After classifying parameter lists, LogDeclaration.valueOf performs a sanity check that at least one list (with or without TOPIC) exists. If the parameter section parsed to nothing, this IllegalArgumentException is thrown (normally the declaration regex prevents reaching it).
Solutions
- Add an explicit parameter list to the factory method, e.g. '(TOPIC)' or '()'.
- Re-check that the declaration string is complete and not truncated after the method name.
- Ensure no invisible characters or line continuations drop the parameter section.
Example fix
// before lombok.log.customDeclaration = com.acme.F.create // after lombok.log.customDeclaration = com.acme.F.create(TOPIC)
Defensive patterns
Strategy: validation
Validate before calling
boolean hasParameterSection(String decl) {
int open = decl.indexOf('(');
return open != -1 && decl.indexOf(')', open) != -1 && !decl.substring(open + 1, decl.indexOf(')', open)).trim().isEmpty() || decl.matches(".*\\(\\s*\\w+.*");
} Try / catch
try {
LogDeclaration decl = LogDeclaration.valueOf(cfgValue);
} catch (IllegalArgumentException e) {
// append a parameter list like (TOPIC) to the factory method
} Prevention
- Always write an explicit parameter list after the factory method name.
- Avoid truncated declarations in lombok.config line continuations.
- Sanity-check the final config file for missing '(TOPIC)'/'()' segments.
When it happens
Trigger: LogDeclaration.valueOf receiving a declaration that matches the pattern but yields an empty parameter-group list — e.g. a blank parameter section that slipped past the regex.
Common situations: Rare edge case with a declaration like 'Factory.create' where the regex matched an empty/whitespace parameter area; usually indicates a malformed custom logger declaration in lombok.config.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- The declaration must follow the pattern: [LoggerType…
- There is more than one parameter definition that includes…
- There is more than one parmaeter definition that does not…
- Minor version must be between 0 and 999
- Lombok supports at most v
AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07).
Data as JSON: /api/errors/d09c330389064184.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/lombok/core/configuration/LogDeclaration.java:76
TypeName loggerType = TypeName.valueOf(matcher.group(1));
if (loggerType == null) loggerType = loggerFactoryType;
IdentifierName loggerFactoryMethod = IdentifierName.valueOf(matcher.group(3));
List<List<LogFactoryParameter>> allParameters = parseParameters(matcher.group(4));
List<LogFactoryParameter> parametersWithoutTopic = null;
List<LogFactoryParameter> parametersWithTopic = null;
for (List<LogFactoryParameter> parameters: allParameters) {
if (parameters.contains(LogFactoryParameter.TOPIC)) {
if (parametersWithTopic != null) throw new IllegalArgumentException("There is more than one parameter definition that includes TOPIC: " + parametersWithTopic + " and " + parameters);
parametersWithTopic = parameters;
} else {
if (parametersWithoutTopic != null) throw new IllegalArgumentException("There is more than one parmaeter definition that does not include TOPIC: " + parametersWithoutTopic + " and " + parameters);
parametersWithoutTopic = parameters;
}
}
// sanity check (the pattern should disallow this situation
if (parametersWithoutTopic == null && parametersWithTopic == null) throw new IllegalArgumentException("No logger factory method parameters specified.");
return new LogDeclaration(loggerType, loggerFactoryType, loggerFactoryMethod, parametersWithoutTopic, parametersWithTopic);
}
private static List<List<LogFactoryParameter>> parseParameters(String parametersDefinitions) {
List<List<LogFactoryParameter>> allParameters = new ArrayList<List<LogFactoryParameter>>();
Matcher matcher = PARAMETERS_PATTERN.matcher(parametersDefinitions);
while (matcher.find()) {
String parametersDefinition = matcher.group(1);
List<LogFactoryParameter> parameters = new ArrayList<LogFactoryParameter>();
if (!parametersDefinition.isEmpty()) {
for (String parameter : parametersDefinition.split(",")) {
parameters.add(LogFactoryParameter.valueOf(parameter));
}
}
allParameters.add(parameters);
}
return allParameters;View on GitHub (pinned to 6d6a3e9fec)