Skip to content

Commit 51d0fb3

Browse files
committed
Fix ThreadContextMap selection algorithm
1 parent 1a88ef3 commit 51d0fb3

File tree

1 file changed

+2
-2
lines changed
  • log4j-api/src/main/java/org/apache/logging/log4j/spi

1 file changed

+2
-2
lines changed

log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ public String getThreadContextMap() {
326326
return threadContextMapClass;
327327
}
328328
// Default based on properties
329-
if (props.getBooleanProperty(GC_FREE_THREAD_CONTEXT_PROPERTY, !Constants.IS_WEB_APP)) {
329+
if (props.getBooleanProperty(GC_FREE_THREAD_CONTEXT_PROPERTY)) {
330330
return GARBAGE_FREE_CONTEXT_MAP;
331331
}
332-
return Constants.IS_WEB_APP ? WEB_APP_CONTEXT_MAP : COPY_ON_WRITE_CONTEXT_MAP;
332+
return Constants.ENABLE_THREADLOCALS ? COPY_ON_WRITE_CONTEXT_MAP : WEB_APP_CONTEXT_MAP;
333333
}
334334

335335
/**

0 commit comments

Comments
 (0)