From d123de6452b13eb725e8aa98233664e8a7f20c13 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 21 Jan 2023 06:04:06 +0100 Subject: [PATCH] IDEMPIERE-5548 Issues with Log Management (#1640) * IDEMPIERE-5548 Issues with Log Management - removed the button Reload Log Props from the About Dialog as is now being reloaded when changing level * - set level also on handlers - restore the button Reload Log Props --- .../src/org/compiere/util/CLogMgt.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/CLogMgt.java b/org.adempiere.base/src/org/compiere/util/CLogMgt.java index 90295dc5ae..26f349a4fd 100644 --- a/org.adempiere.base/src/org/compiere/util/CLogMgt.java +++ b/org.adempiere.base/src/org/compiere/util/CLogMgt.java @@ -26,6 +26,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Enumeration; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; @@ -307,10 +308,26 @@ public class CLogMgt { initialize(true); } - + else + { + for (Handler handler : handlers) + { + handler.setLevel(level); + } + } + // JDBC if ALL setJDBCDebug(level.intValue() == Level.ALL.intValue()); - // + + // Set the log level for all the existing loggers + LogManager mgr = LogManager.getLogManager(); + Iterator ln = mgr.getLoggerNames().asIterator(); + while (ln.hasNext()) + { + String cl = ln.next(); + CLogger.getCLogger(cl, false).setLevel(level); + } + getRootLogger().setLevel(level); } else {