WW-5428 Stop excessive logging in DevMode

This commit is contained in:
Kusal Kithul-Godage
2024-07-09 03:56:17 +10:00
parent 3693ea2eec
commit 9fe1a4a031
@@ -224,7 +224,6 @@ public class SecurityMemberAccess implements MemberAccess {
*/
protected boolean checkAllowlist(Object target, Member member) {
if (!enforceAllowlistEnabled) {
logAllowlistDisabled();
return true;
}
@@ -259,21 +258,6 @@ public class SecurityMemberAccess implements MemberAccess {
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;