From 2aec4d84de361be26d20a3a6d5dd05cad3f73953 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) --- 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; } }