From abfb2f4568c3865a1ae36bbbe2aae3db5450b1e0 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 13 Jul 2024 23:41:33 +1000 Subject: [PATCH] WW-5428 Stop further excessive logging in DevMode --- .../com/opensymphony/xwork2/ognl/SecurityMemberAccess.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java index 333fd276a4..f15b50af1e 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java @@ -90,6 +90,7 @@ public class SecurityMemberAccess implements MemberAccess { private Set excludedPackageNames = emptySet(); private Set excludedPackageExemptClasses = emptySet(); + private static volatile boolean isDevModeLogged = false; private volatile boolean isDevModeInit; private boolean isDevMode; private Set devModeExcludedClasses = unmodifiableSet(new HashSet<>(singletonList(Object.class.getName()))); @@ -536,7 +537,10 @@ private void useDevModeConfiguration() { return; } isDevModeInit = true; - LOG.warn("Working in devMode, using devMode excluded classes and packages!"); + if (!isDevModeLogged) { + LOG.warn("Working in devMode, using devMode excluded classes and packages!"); + isDevModeLogged = true; + } excludedClasses = devModeExcludedClasses; excludedPackageNamePatterns = devModeExcludedPackageNamePatterns; excludedPackageNames = devModeExcludedPackageNames;