Merge pull request #982 from apache/WW-5428-stop-excessive-logging

WW-5428 Stop excessive logging in DevMode
This commit is contained in:
Kusal Kithul-Godage
2024-07-09 05:44:33 +10:00
committed by GitHub
@@ -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;