public boolean logIfDenied() {
        return logIfDenied;
    }
Indicates if audit logs tracking DENIED access should include this action if result is
DENIED. The flag is true if access to a resource was explicitly requested and request
is denied as a result of this authorization request. The flag is false if request was
filtering out authorized resources (e.g. to subscribe to regex pattern). The flag is also
false if this is an optional authorization where an alternative resource authorization is
applied if this fails (e.g. Cluster:Create which is subsequently overridden by Topic:Create).
clients/src/main/java/org/apache/kafka/server/authorizer/Action.java