You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/06/03 10:07:45 UTC
logging-log4j2 git commit: [LOG4J2-1025] Custom
java.util.logging.Level gives null Log4j Level and causes NPE. Do not allow
concurrent init of custom levels.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 4da40ede9 -> 4c791f8e5
[LOG4J2-1025] Custom java.util.logging.Level gives null Log4j Level and
causes NPE. Do not allow concurrent init of custom levels.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/4c791f8e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4c791f8e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4c791f8e
Branch: refs/heads/master
Commit: 4c791f8e58ce0cfb86ed6b1f5449213dffac7316
Parents: 4da40ed
Author: Gary Gregory <ga...@gmail.com>
Authored: Wed Jun 3 01:07:42 2015 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Wed Jun 3 01:07:42 2015 -0700
----------------------------------------------------------------------
.../org/apache/logging/log4j/jul/DefaultLevelConverter.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4c791f8e/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
----------------------------------------------------------------------
diff --git a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
index c2d8eb3..75ae919 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/DefaultLevelConverter.java
@@ -74,7 +74,11 @@ public class DefaultLevelConverter implements LevelConverter {
}
- private Level addCustomJulLevel(java.util.logging.Level customJavaLevel) {
+ private synchronized Level addCustomJulLevel(java.util.logging.Level customJavaLevel) {
+ final Level level = julToLog4j.get(customJavaLevel);
+ if (level != null) {
+ return level;
+ }
long prevDist = Long.MAX_VALUE;
java.util.logging.Level prevLevel = null;
for (java.util.logging.Level mappedJavaLevel : sortedJulLevels) {