File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
log4j-jul/src/main/java/org/apache/logging/log4j/jul Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -179,13 +179,15 @@ public void publish(final LogRecord record) {
179179 }
180180
181181 if (this .installAsLevelPropagator ) {
182- @ SuppressWarnings ("resource" ) // no need to close the AutoCloseable ctx here
183- LoggerContext context = LoggerContext .getContext (false );
184- context .addConfigurationStartedListener (this );
185- propagateLogLevels (context .getConfiguration ());
186- // note: java.util.logging.LogManager.addPropertyChangeListener() could also
187- // be set here, but a call of JUL.readConfiguration() will be done on purpose
188- this .installAsLevelPropagator = false ;
182+ synchronized (this ) {
183+ @ SuppressWarnings ("resource" ) // no need to close the AutoCloseable ctx here
184+ LoggerContext context = LoggerContext .getContext (false );
185+ context .addConfigurationStartedListener (this );
186+ propagateLogLevels (context .getConfiguration ());
187+ // note: java.util.logging.LogManager.addPropertyChangeListener() could also
188+ // be set here, but a call of JUL.readConfiguration() will be done on purpose
189+ this .installAsLevelPropagator = false ;
190+ }
189191 }
190192
191193 org .apache .logging .log4j .Logger log4jLogger = getLog4jLogger (record );
You can’t perform that action at this time.
0 commit comments