in log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java [281:320]
public Object invoke(Object o, Method method, Object[] objects) {
if (method.getName().equals("toString") && method.getParameterCount() == 0) {
return msg.toString();
}
if (method.getName().equals("logEvent")) {
runMessageAction(() -> validateEvent(intrface, msg), msg, auditExceptionHandler);
logEvent(msg, auditExceptionHandler);
return null;
}
if (method.getName().equals("setCompletionStatus")) {
if (objects == null || objects[0] == null) {
throw new IllegalArgumentException("Missing completion status");
}
String name = NamingUtils.lowerFirst(NamingUtils.getMethodShortName(method.getName()));
msg.put(name, objects[0].toString());
return null;
}
if (method.getName().equals("setAuditExceptionHandler")) {
if (objects == null || objects[0] == null) {
auditExceptionHandler = NOOP_EXCEPTION_HANDLER;
} else if (objects[0] instanceof AuditExceptionHandler) {
auditExceptionHandler = (AuditExceptionHandler) objects[0];
} else {
throw new IllegalArgumentException(objects[0] + " is not an " + AuditExceptionHandler.class.getName());
}
return null;
}
if (method.getName().startsWith("set")) {
runMessageAction(() -> setProperty(method, objects), msg, auditExceptionHandler);
return null;
}
return null;
}