From 4c77f387c218df9be011b3c2c072f41981127a13 Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Tue, 23 Apr 2024 16:37:36 -0700 Subject: [PATCH] [LOGMGR-352] Deprecate the per-thread log filters. https://issues.redhat.com/browse/LOGMGR-352 Signed-off-by: James R. Perkins --- src/main/java/org/jboss/logmanager/LogManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/jboss/logmanager/LogManager.java b/src/main/java/org/jboss/logmanager/LogManager.java index 7241d28f..bf956baa 100644 --- a/src/main/java/org/jboss/logmanager/LogManager.java +++ b/src/main/java/org/jboss/logmanager/LogManager.java @@ -43,7 +43,9 @@ */ public final class LogManager extends java.util.logging.LogManager { + @Deprecated(forRemoval = true, since = "3.0.5") public static final String PER_THREAD_LOG_FILTER_KEY = "org.jboss.logmanager.useThreadLocalFilter"; + @Deprecated(forRemoval = true, since = "3.0.5") static final boolean PER_THREAD_LOG_FILTER; static { @@ -244,7 +246,10 @@ public Logger getLogger(String name) { *

* * @return the filter set for the thread or {@code null} if no level was set + * @deprecated this is mainly un-used code and a {@link Filter} attached to the root logger with + * {@link Logger#setUseParentFilters(boolean)} set to {@code true} should be enough */ + @Deprecated(forRemoval = true, since = "3.0.5") public static Filter getThreadLocalLogFilter() { return PER_THREAD_LOG_FILTER ? LocalFilterHolder.LOCAL_FILTER.get() : null; } @@ -256,7 +261,10 @@ public static Filter getThreadLocalLogFilter() { *

* * @param filter the filter to set for all loggers on this thread + * @deprecated this is mainly un-used code and a {@link Filter} attached to the root logger with + * {@link Logger#setUseParentFilters(boolean)} set to {@code true} should be enough */ + @Deprecated(forRemoval = true, since = "3.0.5") public static void setThreadLocalLogLevel(final Filter filter) { if (PER_THREAD_LOG_FILTER) { LocalFilterHolder.LOCAL_FILTER.set(filter);