From 8ba8e14f667d3bac298aafaf68ae933a1d2f36ff Mon Sep 17 00:00:00 2001 From: DavesMan Date: Mon, 24 Jan 2022 08:18:24 +0100 Subject: [PATCH] SLF4J-165 Handling of unknown (custom) priorities is different than in log4j (throwing an IllegalStateException than using the effective level of the given Priority / Level / Category) Signed-off-by: DavesMan --- log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java index fc8b50c20..5edde37f5 100644 --- a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java +++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java @@ -323,7 +323,8 @@ private int priorityToLevelInt(Priority p) { case Priority.FATAL_INT: return LocationAwareLogger.ERROR_INT; default: - throw new IllegalStateException("Unknown Priority " + p); + slf4jLogger.warn("Unknown Priority " + p); + return LocationAwareLogger.TRACE_INT; } }