Skip to content

Commit

Permalink
WW-5428 Stop excessive logging in DevMode
Browse files Browse the repository at this point in the history
  • Loading branch information
kusalk committed Jul 8, 2024
1 parent 3693ea2 commit 9fe1a4a
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ public boolean isAccessible(Map context, Object target, Member member, String pr
*/
protected boolean checkAllowlist(Object target, Member member) {
if (!enforceAllowlistEnabled) {
logAllowlistDisabled();
return true;
}

Expand Down Expand Up @@ -259,21 +258,6 @@ protected boolean checkAllowlist(Object target, Member member) {
return true;
}

private void logAllowlistDisabled() {
if (!isDevMode && !LOG.isDebugEnabled()) {
return;
}
String msg = "OGNL allowlist is disabled!" +
" We strongly recommend keeping it enabled to protect against critical vulnerabilities." +
" Set the configuration `{0}=true` to enable it.";
Object[] args = {StrutsConstants.STRUTS_ALLOWLIST_ENABLE};
if (isDevMode) {
LOG.warn(msg, args);
} else {
LOG.debug(msg, args);
}
}

private void logAllowlistHibernateEntity(Object original, Object resolved) {
if (!isDevMode && !LOG.isDebugEnabled()) {
return;
Expand Down

0 comments on commit 9fe1a4a

Please sign in to comment.