This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/main by this push:
new 53fc17c201 Document properties enhancements. Reorder so context
properties follow environment properties. Move some properties to different
modules. Add constructor to SystemClock to only look up properties once.
53fc17c201 is described below
commit 53fc17c2017e324833bc2efec6585b3d7161ec8f
Author: Ralph Goers <[email protected]>
AuthorDate: Sun May 21 13:10:03 2023 -0700
Document properties enhancements. Reorder so context properties follow
environment properties. Move some properties to different modules. Add
constructor to SystemClock to only look up properties once.
---
.../util/LegacyPropertiesCompatibilityTest.java | 1 -
.../log4j/internal/CopyOnWriteNavigableSet.java | 267 ++++++
.../logging/log4j/spi/LoggingSystemProperty.java | 30 +-
.../apache/logging/log4j/util/PropertiesUtil.java | 29 +-
.../src/main/resources/log4j2.propertyMapping.json | 4 +-
.../util/NamedLoggerContextPropertiesTest.java | 3 +-
.../logging/log4j/core/impl/Log4jPropertyKey.java | 43 +-
.../log4j/core/time/internal/SystemClock.java | 15 +-
.../apache/logging/log4j/core/util/UuidUtil.java | 4 +-
.../src/main/resources/log4j2.propertyMapping.json | 51 +-
.../gctests/GcFreeAsynchronousLoggingTest.java | 5 +-
.../log4j/gctests/GcFreeLoggingTestUtil.java | 6 +-
.../org/apache/logging/log4j/jul/Constants.java | 45 -
.../apache/logging/log4j/jul/JulPropertyKey.java | 76 ++
.../apache/logging/log4j/jul/LevelConverter.java | 2 +-
.../apache/logging/log4j/jul/LevelTranslator.java | 2 +-
.../org/apache/logging/log4j/jul/LogManager.java | 11 +-
.../src/main/resources/log4j2.propertyMapping.json | 6 +
.../logging/log4j/jul/test/ApiLoggerTest.java | 6 +-
.../logging/log4j/script/ScriptManagerImpl.java | 3 +-
.../logging/log4j/script/ScriptPropertyKey.java | 80 ++
.../script/factory/ScriptManagerFactoryImpl.java | 5 +-
log4j-script/src/main/module/module-info.java | 1 +
.../appender/ScriptAppenderSelectorTest.java | 4 +-
.../RollingAppenderDeleteScriptFri13thTest.java | 4 +-
.../rolling/RollingAppenderDeleteScriptTest.java | 4 +-
.../rolling/action/ScriptConditionTest.java | 4 +-
.../routing/DefaultRouteScriptAppenderTest.java | 4 +-
.../appender/routing/RoutesScriptAppenderTest.java | 4 +-
.../log4j/script/config/TestConfigurator.java | 4 +-
.../script/config/arbiter/ScriptArbiterTest.java | 4 +-
.../filter/ScriptFileFilterPropertiesTest.java | 4 +-
.../log4j/script/filter/ScriptFileFilterTest.java | 4 +-
.../log4j/script/filter/ScriptFilterTest.java | 4 +-
.../log4j/script/filter/ScriptRefFilterTest.java | 4 +-
.../log4j/script/layout/PatternSelectorTest.java | 4 +-
src/site/asciidoc/manual/configuration.adoc | 837 -------------------
src/site/asciidoc/manual/systemproperties.adoc | 926 +++++++++++++++++++++
src/site/site.xml | 2 +-
39 files changed, 1526 insertions(+), 986 deletions(-)
diff --git
a/log4j-api-test/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java
b/log4j-api-test/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java
index b4b2e010a3..0b82573af2 100644
---
a/log4j-api-test/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java
+++
b/log4j-api-test/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java
@@ -36,7 +36,6 @@ public class LegacyPropertiesCompatibilityTest {
{"log4j2.clock", "Configuration.clock"},
{"log4j2.level", "Configuration.level"},
{"log4j2.isThreadContextMapInheritable",
"ThreadContext.inheritable"},
- {"log4j2.contextDataInjector",
"ThreadContext.contextDataInjector"},
{"log4j2.garbagefreeThreadContextMap",
"ThreadContext.garbageFreeMap"},
{"log4j2.jmxNotifyAsync", "JMX.notifyAsync"},
{"log4j2.ignoreTCL", "Loader.ignoreTCL"},
diff --git
a/log4j-api/src/main/java/org/apache/logging/log4j/internal/CopyOnWriteNavigableSet.java
b/log4j-api/src/main/java/org/apache/logging/log4j/internal/CopyOnWriteNavigableSet.java
new file mode 100644
index 0000000000..efc8970180
--- /dev/null
+++
b/log4j-api/src/main/java/org/apache/logging/log4j/internal/CopyOnWriteNavigableSet.java
@@ -0,0 +1,267 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.logging.log4j.internal;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.NavigableSet;
+import java.util.SortedSet;
+import java.util.Spliterator;
+import java.util.TreeSet;
+import java.util.function.Consumer;
+import java.util.function.IntFunction;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+
+public class CopyOnWriteNavigableSet<E> extends TreeSet<E> {
+
+ private volatile NavigableSet<E> set;
+ private final Comparator<? super E> comparator;
+
+ public CopyOnWriteNavigableSet(Comparator<? super E> comparator) {
+ set = new TreeSet<>(comparator);
+ this.comparator = comparator;
+ }
+
+ private CopyOnWriteNavigableSet(CopyOnWriteNavigableSet<E> copyOnWriteSet)
{
+ this.set = new TreeSet<>(copyOnWriteSet.set);
+ this.comparator = copyOnWriteSet.comparator;
+ }
+
+ @Override
+ public Iterator<E> iterator() {
+ return set.iterator();
+ }
+
+ @Override
+ public Iterator<E> descendingIterator() {
+ return set.descendingIterator();
+ }
+
+ @Override
+ public NavigableSet<E> descendingSet() {
+ return set.descendingSet();
+ }
+
+ @Override
+ public int size() {
+ return set.size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return set.isEmpty();
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ return set.contains(o);
+ }
+
+ @Override
+ public boolean add(E e) {
+ NavigableSet<E> newSet = new TreeSet<E>(set);
+ boolean result = newSet.add(e);
+ if (result) {
+ set = newSet;
+ }
+ return result;
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ NavigableSet<E> newSet = new TreeSet<E>(set);
+ boolean result = newSet.remove(o);
+ if (result) {
+ set = newSet;
+ }
+ return result;
+ }
+
+ @Override
+ public void clear() {
+ NavigableSet<E> newSet = new TreeSet<E>(set);
+ newSet.clear();
+ set = newSet;
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends E> c) {
+ NavigableSet<E> newSet = new TreeSet<E>(set);
+ boolean result = newSet.addAll(c);
+ if (result) {
+ set = newSet;
+ }
+ return result;
+ }
+
+ @Override
+ public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E
toElement, boolean toInclusive) {
+ return set.subSet(fromElement, fromInclusive, toElement, toInclusive);
+ }
+
+ @Override
+ public NavigableSet<E> headSet(E toElement, boolean inclusive) {
+ return set.headSet(toElement, inclusive);
+ }
+
+ @Override
+ public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
+ return set.tailSet(fromElement, inclusive);
+ }
+
+ @Override
+ public SortedSet<E> subSet(E fromElement, E toElement) {
+ return set.subSet(fromElement, toElement);
+ }
+
+ @Override
+ public SortedSet<E> headSet(E toElement) {
+ return set.headSet(toElement);
+ }
+
+ @Override
+ public SortedSet<E> tailSet(E fromElement) {
+ return set.tailSet(fromElement);
+ }
+
+ @Override
+ public Comparator<? super E> comparator() {
+ return comparator;
+ }
+
+ @Override
+ public E first() {
+ return set.first();
+ }
+
+ @Override
+ public E last() {
+ return set.last();
+ }
+
+ @Override
+ public E lower(E e) {
+ return set.lower(e);
+ }
+
+ @Override
+ public E floor(E e) {
+ return set.floor(e);
+ }
+
+ @Override
+ public E ceiling(E e) {
+ return set.ceiling(e);
+ }
+
+ @Override
+ public E higher(E e) {
+ return set.higher(e);
+ }
+
+ @Override
+ public E pollFirst() {
+ return set.pollFirst();
+ }
+
+ @Override
+ public E pollLast() {
+ return set.pollLast();
+ }
+
+ @Override
+ public Object clone() {
+ return new CopyOnWriteNavigableSet<E>(this);
+ }
+
+ @Override
+ public Spliterator<E> spliterator() {
+ return set.spliterator();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return set.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return set.hashCode();
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ return set.removeAll(c);
+ }
+
+ @Override
+ public Object[] toArray() {
+ return set.toArray();
+ }
+
+ @Override
+ public <T> T[] toArray(T[] a) {
+ return set.toArray(a);
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> c) {
+ return set.containsAll(c);
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ return set.retainAll(c);
+ }
+
+ @Override
+ public String toString() {
+ return set.toString();
+ }
+
+ @Override
+ public <T> T[] toArray(IntFunction<T[]> generator) {
+ return set.toArray(generator);
+ }
+
+ @Override
+ public boolean removeIf(Predicate<? super E> filter) {
+ NavigableSet<E> newSet = new TreeSet<E>(set);
+ boolean result = newSet.removeIf(filter);
+ if (result) {
+ this.set = newSet;
+ }
+ return result;
+ }
+
+ @Override
+ public Stream<E> stream() {
+ return set.stream();
+ }
+
+ @Override
+ public Stream<E> parallelStream() {
+ return set.parallelStream();
+ }
+
+ @Override
+ public void forEach(Consumer<? super E> action) {
+ set.forEach(action);
+ }
+}
diff --git
a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggingSystemProperty.java
b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggingSystemProperty.java
index e7edbe59a9..eeb5fb1fcb 100644
---
a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggingSystemProperty.java
+++
b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggingSystemProperty.java
@@ -185,7 +185,6 @@ public enum LoggingSystemProperty implements PropertyKey {
*/
// GC.unboxRingBufferSize
UNBOX_RING_BUFFER_SIZE(PropertyComponent.GC,
Constant.UNBOX_RING_BUFFER_SIZE),
- UUID_SEQUENCE(PropertyComponent.UUID,Constant.SEQUENCE),
/**
* Property to override webapp detection. Without this property, the
presence of the {@code Servlet} interface
* (from either {@code javax} or {@code jakarta}) is checked to see if
this is a webapp.
@@ -196,18 +195,24 @@ public enum LoggingSystemProperty implements PropertyKey {
public static final String SIMPLE_LOGGER_LOG_LEVEL =
"SimpleLogger.%s.level";
public static final String SYSTEM_PROPERTY_PREFIX = "log4j2.*.";
- private PropertyComponent component;
- private String name;
+ private final PropertyComponent component;
+ private final String name;
+
+ private final String key;
+ private final String systemKey;
LoggingSystemProperty(final PropertyComponent component, String name) {
this.component = component;
this.name = name;
+ this.key = component.getName() + Constant.DELIM + name;
+ this.systemKey = SYSTEM_PROPERTY_PREFIX + this.key;
}
public static LoggingSystemProperty findKey(String component, String name)
{
- for (LoggingSystemProperty key : values()) {
- if (key.getComponent().equals(component) &&
key.getName().equals(name)) {
- return key;
+ String toFind = component + Constant.DELIM + name;
+ for (LoggingSystemProperty property : values()) {
+ if (property.key.equals(toFind)) {
+ return property;
}
}
return null;
@@ -221,6 +226,16 @@ public enum LoggingSystemProperty implements PropertyKey {
return name;
}
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public String getSystemKey() {
+ return systemKey;
+ }
+
public String toString() {
return getKey();
}
@@ -437,9 +452,6 @@ public enum LoggingSystemProperty implements PropertyKey {
public static final String THREAD_CONTEXT_GARBAGE_FREE_ENABLED =
SYSTEM_PROPERTY_PREFIX +
PropertyComponent.Constant.THREAD_CONTEXT + DELIM + GARBAGE_FREE;
- static final String SEQUENCE = "sequence";
- public static final String UUID_SEQUENCE = SYSTEM_PROPERTY_PREFIX
- + PropertyComponent.Constant.UUID + DELIM + SEQUENCE;
static final String IS_WEB_APP = "isWebApp";
public static final String WEB =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.WEB + DELIM + IS_WEB_APP;
diff --git
a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
index 4450e6e9b5..4e85c18781 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
@@ -29,13 +29,15 @@ import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.NavigableSet;
import java.util.Objects;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentSkipListSet;
+
+import org.apache.logging.log4j.internal.CopyOnWriteNavigableSet;
/**
@@ -317,7 +319,7 @@ public class PropertiesUtil implements PropertyEnvironment {
URL url = urls.nextElement();
try (InputStream is = url.openStream()) {
String json = new String(is.readAllBytes(),
StandardCharsets.UTF_8);
- PropertySource propertySource = parseJsonProperties(json,
contextName, 10);
+ PropertySource propertySource = parseJsonProperties(json,
contextName, 110);
if (propertySource != null) {
sources.add(propertySource);
}
@@ -336,7 +338,7 @@ public class PropertiesUtil implements PropertyEnvironment {
try (InputStream is = url.openStream()) {
Properties props = new Properties();
props.load(is);
- PropertySource source = new
PropertiesPropertySource(props, contextName, 20);
+ PropertySource source = new
PropertiesPropertySource(props, contextName, 120);
sources.add(source);
} catch (Exception ex) {
LowLevelLogUtil.logException("Unable to access properties
for " + url.toString(), ex);
@@ -433,7 +435,8 @@ public class PropertiesUtil implements PropertyEnvironment {
*/
private static class Environment implements PropertyEnvironment {
- private final Set<PropertySource> sources = new
ConcurrentSkipListSet<>(new PropertySource.Comparator());
+ private final NavigableSet<PropertySource> sources =
+ new CopyOnWriteNavigableSet<>(new PropertySource.Comparator());
/**
* Maps a key to its value or the value of its normalization in the
lowest priority source that contains it.
*/
@@ -508,7 +511,9 @@ public class PropertiesUtil implements PropertyEnvironment {
String result = null;
String contextKey = getContextKey(key);
if (contextName != null &&
!contextName.equals(PropertySource.SYSTEM_CONTEXT)) {
- for (final PropertySource source : sources) {
+ // These loops are a little unconventional but it is garbage
free.
+ PropertySource source = sources.first();
+ while (source != null) {
if (source instanceof ContextAwarePropertySource) {
ContextAwarePropertySource src = Cast.cast(source);
result = src.getProperty(contextName, contextKey);
@@ -516,13 +521,16 @@ public class PropertiesUtil implements
PropertyEnvironment {
if (result != null) {
return result;
}
+ source = sources.higher(source);
}
}
- for (final PropertySource source : sources) {
+ PropertySource source = sources.first();
+ while (source != null) {
result = source.getProperty(contextKey);
if (result != null) {
return result;
}
+ source = sources.higher(source);
}
return result;
}
@@ -534,16 +542,20 @@ public class PropertiesUtil implements
PropertyEnvironment {
}
String contextKey = getContextKey(key);
if (!contextName.equals(PropertySource.SYSTEM_CONTEXT)) {
- for (final PropertySource source : sources) {
+ // These loops are a little unconventional but it is garbage
free.
+ PropertySource source = sources.first();
+ while (source != null) {
if (source instanceof ContextAwarePropertySource) {
ContextAwarePropertySource src = Cast.cast(source);
if (src.containsProperty(contextName, contextKey)) {
return true;
}
}
+ source = sources.higher(source);
}
}
- for (final PropertySource source : sources) {
+ PropertySource source = sources.first();
+ while (source != null) {
if (source instanceof ContextAwarePropertySource) {
ContextAwarePropertySource src = Cast.cast(source);
if (src.containsProperty(contextName, contextKey)
@@ -556,6 +568,7 @@ public class PropertiesUtil implements PropertyEnvironment {
return true;
}
}
+ source = sources.higher(source);
}
return false;
}
diff --git a/log4j-api/src/main/resources/log4j2.propertyMapping.json
b/log4j-api/src/main/resources/log4j2.propertyMapping.json
index d5730cf2e8..6a07494108 100644
--- a/log4j-api/src/main/resources/log4j2.propertyMapping.json
+++ b/log4j-api/src/main/resources/log4j2.propertyMapping.json
@@ -1,7 +1,6 @@
{
"log4j2": {
"assignedSequences": ["UUID", "assignedSequences"],
- "contextDataInjector": ["ThreadContext", "contextDataInjector"],
"debug": ["StatusLogger", "enableDebug"],
"defaultStatusLevel": ["StatusLogger", "defaultLevel"],
"garbagefreeThreadContextMap": ["ThreadContext", "garbageFreeMap"],
@@ -25,6 +24,7 @@
"simplelogStatusLoggerLevel": ["SimpleLogger", "statusLoggerLevel"],
"statusLoggerLevel": ["StatusLogger", "level"],
"statusEntries": ["StatusLogger", "entries"],
+ "threadContextMap": ["ThreadContext", "mapClass"],
"unboxRingbufferSize": ["Unbox", "ringBufferSize"],
"uuidSequence": ["UUID", "sequence"]
},
@@ -33,7 +33,6 @@
},
"LOG4J": {
"ASSIGNED_SEQUENCES": ["UUID", "assignedSequences"],
- "CONTEXT_DATA_INJECTOR": ["ThreadContext", "contextDataInjector"],
"DEBUG": ["StatusLogger", "enableDebug"],
"DEFAULT_STATUS_LEVEL": ["StatusLogger", "defaultLevel"],
"GARBAGEFREE_THREAD_CONTEXT_MAP": ["ThreadContext", "garbageFreeMap"],
@@ -58,6 +57,7 @@
"LOG4J_SIMPLELOG_STATUS_LOGGER_LEVEL": ["SimpleLogger",
"statusLoggerLevel"],
"STATUS_LOGGER_LEVEL": ["StatusLogger", "level"],
"STATUS_ENTRIES": ["StatusLogger", "entries"],
+ "THREAD_CONTEXT_MAP": ["ThreadContext", "mapClass"],
"UNBOX_RINGBUFFER_SIZE": ["Unbox", "ringBufferSize"],
"UUID_SEQUENCE": ["UUID", "sequence"]
}
diff --git
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/util/NamedLoggerContextPropertiesTest.java
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/util/NamedLoggerContextPropertiesTest.java
index 76bab536b7..d552603fff 100644
---
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/util/NamedLoggerContextPropertiesTest.java
+++
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/util/NamedLoggerContextPropertiesTest.java
@@ -22,7 +22,6 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LifeCycle;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.selector.BasicContextSelector;
import org.apache.logging.log4j.core.test.junit.ContextSelectorType;
import org.apache.logging.log4j.plugins.Inject;
@@ -42,7 +41,7 @@ public class NamedLoggerContextPropertiesTest {
assertEquals(LifeCycle.State.STARTED, context.getState());
PropertiesUtil props = context.getProperties();
assertNotNull(props, "Logger Context Properties were not loaded");
- String scriptLanguages =
props.getStringProperty(Log4jPropertyKey.SCRIPT_ENABLE_LANGUAGES);
+ String scriptLanguages =
props.getStringProperty("Script.enableLanguages");
assertEquals("Groovy,JavaScript", scriptLanguages);
Configuration config = context.getConfiguration();
assertNotNull(config, "Configuration was not created");
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jPropertyKey.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jPropertyKey.java
index 57969298da..82bc5e470f 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jPropertyKey.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jPropertyKey.java
@@ -53,7 +53,7 @@ public enum Log4jPropertyKey implements PropertyKey {
Constant.WAIT_MILLIS_BEFORE_STOP_OLD_CONFIG),
CONFIG_V1_COMPATIBILITY_ENABLED(PropertyComponent.LOG4J1,
Constant.COMPATIBILITY),
CONFIG_V1_FILE_NAME(PropertyComponent.LOG4J, Constant.CONFIGURATION),
- CONTEXT_SELECTOR_CLASS_NAME(PropertyComponent.LOG4J,
Constant.CONTEXT_SELECTOR),
+ CONTEXT_SELECTOR_CLASS_NAME(PropertyComponent.LOGGER_CONTEXT,
Constant.SELECTOR),
GC_ENABLE_DIRECT_ENCODERS(PropertyComponent.GC,
Constant.ENABLE_DIRECT_ENCODERS),
GC_ENCODER_BYTE_BUFFER_SIZE(PropertyComponent.GC,
Constant.ENCODER_BYTE_BUFFER_SIZE),
GC_ENCODER_CHAR_BUFFER_SIZE(PropertyComponent.GC,
Constant.ENCODER_CHAR_BUFFER_SIZE),
@@ -67,7 +67,6 @@ public enum Log4jPropertyKey implements PropertyKey {
JNDI_ENABLE_JMS(PropertyComponent.JNDI, Constant.ENABLE_JMS),
JNDI_ENABLE_LOOKUP(PropertyComponent.JNDI, Constant.ENABLE_LOOKUP),
LOG_EVENT_FACTORY_CLASS_NAME(PropertyComponent.LOGGER,
Constant.LOG_EVENT_FACTORY),
- SCRIPT_ENABLE_LANGUAGES(PropertyComponent.SCRIPT,
Constant.ENABLE_LANGUAGES),
SHUTDOWN_CALLBACK_REGISTRY(PropertyComponent.LOGGER_CONTEXT,
Constant.SHUT_DOWN_CALLBACK_REGISTRY),
SHUTDOWN_HOOK_ENABLED(PropertyComponent.LOGGER_CONTEXT,
Constant.SHUT_DOWN_HOOK_ENABLED),
STACKTRACE_ON_START(PropertyComponent.LOGGER_CONTEXT,
Constant.STACK_TRACE_ON_START),
@@ -92,14 +91,22 @@ public enum Log4jPropertyKey implements PropertyKey {
TRANSPORT_SECURITY_KEY_STORE_TYPE(PropertyComponent.TRANSPORT_SECURITY,
Constant.KEYSTORE_TYPE),
TRANSPORT_SECURITY_KEY_STORE_KEY_MANAGER_FACTORY_ALGORITHM(PropertyComponent.TRANSPORT_SECURITY,
Constant.KEYSTORE_KEY_MANAGER_FACTORY_ALGORITHM),
-
TRANSPORT_SECURITY_VERIFY_HOST_NAME(PropertyComponent.TRANSPORT_SECURITY,Constant.SSL_VERIFY_HOST_NAME);
+
TRANSPORT_SECURITY_VERIFY_HOST_NAME(PropertyComponent.TRANSPORT_SECURITY,Constant.SSL_VERIFY_HOST_NAME),
+ USE_PRECISE_CLOCK(PropertyComponent.CONFIGURATION,
Constant.USE_PRECISE_cLOCK),
+ UUID_SEQUENCE(PropertyComponent.UUID, Constant.SEQUENCE);
- private PropertyComponent component;
- private String name;
+ private final PropertyComponent component;
+ private final String name;
+
+ private final String key;
+
+ private final String systemKey;
Log4jPropertyKey(final PropertyComponent component, String name) {
this.component = component;
this.name = name;
+ this.key = component.getName() + Constant.DELIM + name;
+ this.systemKey = LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX + key;
}
public static PropertyKey findKey(String component, String name) {
@@ -119,6 +126,16 @@ public enum Log4jPropertyKey implements PropertyKey {
return name;
}
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public String getSystemKey() {
+ return systemKey;
+ }
+
public String toString() {
return getKey();
}
@@ -211,9 +228,9 @@ public enum Log4jPropertyKey implements PropertyKey {
static final String CONFIGURATION = "configuration";
public static final String CONFIG_V1_FILE_NAME =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.LOG4J1 + DELIM + CONFIGURATION;
- static final String CONTEXT_SELECTOR = "contextSelector";
+ static final String SELECTOR = "selector";
public static final String CONTEXT_SELECTOR_CLASS_NAME =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
- + PropertyComponent.Constant.LOG4J + DELIM + CONTEXT_SELECTOR;
+ + PropertyComponent.Constant.LOGGER_CONTEXT + DELIM + SELECTOR;
static final String ENABLE_DIRECT_ENCODERS = "enableDirectEncoders";
public static final String GC_ENABLE_DIRECT_ENCODERS =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.GC + DELIM +
ENABLE_DIRECT_ENCODERS;
@@ -238,6 +255,7 @@ public enum Log4jPropertyKey implements PropertyKey {
static final String NOTIFY_ASYNC = "notifyAsync";
public static final String JMX_NOTIFY_ASYNC =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.JMX + DELIM + NOTIFY_ASYNC;
+ static final String CONTEXT_SELECTOR = "contextSelector";
public static final String JNDI_CONTEXT_SELECTOR =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.JNDI + DELIM + CONTEXT_SELECTOR;
static final String ENABLE_JDBC = "enableJDBC";
@@ -252,9 +270,6 @@ public enum Log4jPropertyKey implements PropertyKey {
static final String LOG_EVENT_FACTORY = "logEventFactory";
public static final String LOG_EVENT_FACTORY_CLASS_NAME =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.LOGGER_CONTEXT + DELIM +
LOG_EVENT_FACTORY;
- static final String ENABLE_LANGUAGES = "enableLanguages";
- public static final String SCRIPT_ENABLE_LANGUAGES =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
- + PropertyComponent.Constant.SCRIPT + DELIM + ENABLE_LANGUAGES;
static final String SHUT_DOWN_CALLBACK_REGISTRY =
"shutdownCallbackRegistry";
public static final String SHUTDOWN_CALLBACK_REGISTRY =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.LOGGER_CONTEXT + DELIM +
SHUT_DOWN_CALLBACK_REGISTRY;
@@ -322,5 +337,13 @@ public enum Log4jPropertyKey implements PropertyKey {
static final String SSL_VERIFY_HOST_NAME = "sslVerifyHostName";
public static final String TRANSPORT_SECURITY_VERIFY_HOST_NAME =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ PropertyComponent.Constant.TRANSPORT_SECURITY + DELIM +
SSL_VERIFY_HOST_NAME;
+
+ static final String USE_PRECISE_cLOCK = "usePreciseClock";
+ public static final String USE_PRECISE_CLOCK =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ + PropertyComponent.Constant.CONFIGURATION + DELIM +
USE_PRECISE_cLOCK;
+
+ static final String SEQUENCE = "sequence";
+ public static final String UUID_SEQUENCE =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ + PropertyComponent.Constant.UUID + DELIM + SEQUENCE;
}
}
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/SystemClock.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/SystemClock.java
index 5a9e87460d..8402304b0f 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/SystemClock.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/SystemClock.java
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.core.time.internal;
import java.time.Instant;
+import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.time.Clock;
import org.apache.logging.log4j.core.time.MutableInstant;
import org.apache.logging.log4j.core.time.PreciseClock;
@@ -29,11 +30,12 @@ import org.apache.logging.log4j.util.PropertiesUtil;
*/
public final class SystemClock implements Clock, PreciseClock {
- /**
- * The precise clock is not enabled by default, since access to it is not
garbage free.
- */
- private static final boolean USE_PRECISE_CLOCK =
PropertiesUtil.getProperties()
- .getBooleanProperty("log4j2.usePreciseClock", false);
+ private final boolean usePreciseClock;
+ public SystemClock() {
+ usePreciseClock =
+
PropertiesUtil.getProperties().getBooleanProperty(Log4jPropertyKey.USE_PRECISE_CLOCK,
false);
+ }
+
/**
* Returns the system time.
* @return the result of calling {@code System.currentTimeMillis()}
@@ -45,10 +47,11 @@ public final class SystemClock implements Clock,
PreciseClock {
/**
* {@inheritDoc}
+ * The precise clock is not enabled by default, since access to it is not
garbage free.
*/
@Override
public void init(final MutableInstant mutableInstant) {
- if (USE_PRECISE_CLOCK) {
+ if (usePreciseClock) {
final Instant instant = java.time.Clock.systemUTC().instant();
mutableInstant.initFromEpochSecond(instant.getEpochSecond(),
instant.getNano());
} else {
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/UuidUtil.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/UuidUtil.java
index ccaac5809b..db489fead6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/UuidUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/UuidUtil.java
@@ -22,7 +22,7 @@ import java.util.Random;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.logging.log4j.spi.LoggingSystemProperty;
+import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.util.PropertiesUtil;
/**
@@ -39,7 +39,7 @@ public final class UuidUtil {
private static final int SEQUENCE_MASK = 0x3FFF;
private static final long NUM_100NS_INTERVALS_SINCE_UUID_EPOCH =
0x01b21dd213814000L;
private static final long INITIAL_UUID_SEQNO =
-
PropertiesUtil.getProperties().getLongProperty(LoggingSystemProperty.UUID_SEQUENCE,
0);
+
PropertiesUtil.getProperties().getLongProperty(Log4jPropertyKey.UUID_SEQUENCE,
0);
private static final long LOW_MASK = 0xffffffffL;
private static final long MID_MASK = 0xffff00000000L;
diff --git a/log4j-core/src/main/resources/log4j2.propertyMapping.json
b/log4j-core/src/main/resources/log4j2.propertyMapping.json
index 0da2aca044..9be00aef27 100644
--- a/log4j-core/src/main/resources/log4j2.propertyMapping.json
+++ b/log4j-core/src/main/resources/log4j2.propertyMapping.json
@@ -1,9 +1,13 @@
{
+ "AsyncLogger": {
+ "SynchronizeEnqueueWhenQueueFull": ["AsyncLogger",
"synchronizeEnqueueWhenQueueFull"]
+ },
"log4j2": {
"asyncLoggerExceptionHandler": ["AsyncLogger", "exceptionHandler"],
"asyncLoggerRingBufferSize": ["AsyncLogger", "ringBufferSize"],
"asyncLoggerSleepTimeNS": ["AsyncLogger", "sleepTimeNS"],
"asyncLoggerThreadNameStrategy": ["AsyncLogger", "threadNameStrategy"],
+ "asyncLoggerTimeout": ["AsyncLogger", "timeout"],
"asyncLoggerWaitStrategy": ["AsyncLogger", "waitStrategy"],
"asyncLoggerConfigExceptionHandler": ["AsyncLoggerConfig",
"exceptionHandler"],
"asyncLoggerConfigRingBufferSize": ["AsyncLoggerConfig", "ringBufferSize"],
@@ -18,29 +22,32 @@
"Configuration.username": ["Configuration", "username"],
"configurationFactory": ["Configuration", "factory"],
"configurationFile": ["Configuration", "file"],
+ "contextDataInjector": ["ThreadContext", "contextDataInjector"],
"contextSelector": ["LoggerContext", "selector"],
"discardThreshold": ["AsyncLogger", "discardThreshold"],
"enableDirectEncoders": ["GC", "enableDirectEncoders"],
- "enableJndi": ["JNDI", "enabled"],
"formatMsgAsync": ["AsyncLogger", "formatMsg"],
+ "keyStoreLocation": ["TransportSecurity", "keyStoreLocation"],
+ "keyStorePassword": ["TransportSecurity", "keyStorePassword"],
+ "keyStorePasswordFile": ["TransportSecurity", "keyStorePasswordFile"],
+ "keyStorePasswordEnvironmentVariable": ["TransportSecurity",
"keyStorePasswordEnvironmentVariable"],
+ "keyStoreType": ["TransportSecurity", "keyStoreType"],
+ "keyStoreKeyManagerFactoryAlgorithm": ["TransportSecurity",
"keyStoreKeyManagerFactoryAlgorithm"],
"layoutStringBuilderMaxSize": ["GC", "layoutStringBuilderMaxSize"],
"level": ["Configuration", "level"],
"logEventFactory": ["Logger", "logEventFactory"],
+ "loggerContextFactory": [],
"loggerContextStacktraceOnStart": ["LoggerContext", "stackTraceOnStart"],
"mergeStrategy": ["Configuration", "mergeStrategy"],
"shutdownCallbackRegistry": ["LoggerContext", "shutdownCallbackRegistry"],
- "trustStoreLocation": ["Configuration", "trustStoreLocation"],
- "trustStorePassword": ["Configuration", "trustStorePassword"],
- "trustStorePasswordFile": ["Configuration", "trustStorePasswordFile"],
- "trustStorePasswordEnvironmentVariable": ["Configuration",
"trustStorePasswordEnvironmentVariable"],
- "trustStoreType": ["Configuration", "trustStoreType"],
- "trustStoreKeyManagerFactoryAlgorithm": ["Configuration",
"trustStoreKeyManagerFactoryAlgorithm"],
- "keyStoreLocation": ["Configuration", "keyStoreLocation"],
- "keyStorePassword": ["Configuration", "keyStorePassword"],
- "keyStorePasswordFile": ["Configuration", "keyStorePasswordFile"],
- "keyStorePasswordEnvironmentVariable": ["Configuration",
"keyStorePasswordEnvironmentVariable"],
- "keyStoreType": ["Configuration", "keyStoreType"],
- "keyStoreKeyManagerFactoryAlgorithm": ["Configuration",
"keyStoreKeyManagerFactoryAlgorithm"]
+ "shutdownHookEnabled": ["LoggerContext", "shutdownHookEnabled"],
+ "trustStoreLocation": ["TransportSecurity", "trustStoreLocation"],
+ "trustStorePassword": ["TransportSecurity", "trustStorePassword"],
+ "trustStorePasswordFile": ["TransportSecurity", "trustStorePasswordFile"],
+ "trustStorePasswordEnvironmentVariable": ["TransportSecurity",
"trustStorePasswordEnvironmentVariable"],
+ "trustStoreType": ["TransportSecurity", "trustStoreType"],
+ "trustStoreKeyManagerFactoryAlgorithm": ["TransportSecurity",
"trustStoreKeyManagerFactoryAlgorithm"],
+ "usePreciseClock": ["Configuration", "usePreciseClock"]
},
"log4j": {
"configuration": ["log4j1", "configuration"],
@@ -50,11 +57,15 @@
"configurationPasswordDecryptor": ["Configuration", "passwordDecryptor"],
"configurationUsername": ["Configuration", "username"]
},
+ "ASYNC_LOGGER": {
+ "SYNCHRONIZE_ENQUEUE_WHEN_QUEUE_FULL": ["AsyncLogger",
"synchronizeEnqueueWhenQueueFull"]
+ },
"LOG4J": {
"ASYNC_LOGGER_EXCEPTION_HANDLER": ["AsyncLogger", "exceptionHandler"],
"ASYNC_LOGGER_RING_BUFFER_SIZE": ["AsyncLogger", "ringBufferSize"],
"ASYNC_LOGGER_SLEEP_TIME_NS": ["AsyncLogger", "sleepTimeNS"],
"ASYNC_LOGGER_THREAD_NAME_STRATEGY": ["AsyncLogger", "threadNameStrategy"],
+ "ASYNC_LOGGER_TIMEOUT": ["AsyncLogger", "timeout"],
"ASYNC_LOGGER_WAIT_STRATEGY": ["AsyncLogger", "waitStrategy"],
"ASYNC_LOGGER_CONFIG_EXCEPTION_HANDLER": ["AsyncLoggerConfig",
"exceptionHandler"],
"ASYNC_LOGGER_CONFIG_RING_BUFFER_SIZE": ["AsyncLoggerConfig",
"ringBufferSize"],
@@ -68,10 +79,17 @@
"CONFIGURATION_PASSWORD": ["Configuration", "password"],
"CONFIGURATION_PASSWORD_DECRYPTOR": ["Configuration", "passwordDecryptor"],
"CONFIGURATION_USERNAME": ["Configuration", "username"],
+ "CONTEXT_DATA_INJECTOR": ["ThreadContext", "contextDataInjector"],
"CONTEXT_SELECTOR": ["LoggerContext", "selector"],
"DISCARD_THRESHOLD": ["AsyncLogger", "discardThreshold"],
"ENABLE_DIRECT_ENCODERS": ["GC", "enableDirectEncoders"],
"FORMAT_MSG_ASYNC": ["AsyncLogger", "formatMsg"],
+ "KEY_STORE_LOCATION": ["Configuration", "keyStoreLocation"],
+ "KEY_STORE_PASSWORD": ["Configuration", "keyStorePassword"],
+ "KEY_STORE_PASSWORD_FIL": ["Configuration", "keyStorePasswordFile"],
+ "KEY_STORE_PASSWORD_ENVIRONMENT_VARIABLE": ["Configuration",
"keyStorePasswordEnvironmentVariable"],
+ "KEY_STORE_TYPE": ["Configuration", "keyStoreType"],
+ "KEY_STORE_KEY_MANAGER_FACTORY_ALGORITHM": ["Configuration",
"keyStoreKeyManagerFactoryAlgorithm"],
"LAYOUT_STRING_BUILDER_MAX_SIZE": ["GC", "layoutStringBuilderMaxSize"],
"LEVEL": ["Configuration", "level"],
"LOG_EVENT_FACTORY": ["Logger", "logEventFactory"],
@@ -84,11 +102,6 @@
"TRUST_STORE_PASSWORD_ENVIRONMENT_VARIABLE": ["Configuration",
"trustStorePasswordEnvironmentVariable"],
"TRUST_STORE_TYPE": ["Configuration", "trustStoreType"],
"TRUST_STORE_KEY_MANAGER_FACTORY_ALGORITHM": ["Configuration",
"trustStoreKeyManagerFactoryAlgorithm"],
- "KEY_STORE_LOCATION": ["Configuration", "keyStoreLocation"],
- "KEY_STORE_PASSWORD": ["Configuration", "keyStorePassword"],
- "KEY_STORE_PASSWORD_FIL": ["Configuration", "keyStorePasswordFile"],
- "KEY_STORE_PASSWORD_ENVIRONMENT_VARIABLE": ["Configuration",
"keyStorePasswordEnvironmentVariable"],
- "KEY_STORE_TYPE": ["Configuration", "keyStoreType"],
- "KEY_STORE_KEY_MANAGER_FACTORY_ALGORITHM": ["Configuration",
"keyStoreKeyManagerFactoryAlgorithm"]
+ "USE_PRECISE_CLOCK": ["Configuration", "usePreciseClock"]
}
}
\ No newline at end of file
diff --git
a/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeAsynchronousLoggingTest.java
b/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeAsynchronousLoggingTest.java
index b555535a49..368e966adc 100644
---
a/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeAsynchronousLoggingTest.java
+++
b/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeAsynchronousLoggingTest.java
@@ -17,6 +17,7 @@
package org.apache.logging.log4j.gctests;
import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector;
+import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.categories.GarbageFree;
import org.apache.logging.log4j.spi.LoggingSystemProperty;
import org.junit.experimental.categories.Category;
@@ -43,8 +44,8 @@ public class GcFreeAsynchronousLoggingTest {
*/
public static void main(final String[] args) throws Exception {
System.setProperty(LoggingSystemProperty.THREAD_CONTEXT_GARBAGE_FREE_ENABLED.getSystemKey(),
"true");
- System.setProperty("AsyncLogger.RingBufferSize", "128"); // minimum
ringbuffer size
- System.setProperty("Log4jContextSelector",
AsyncLoggerContextSelector.class.getName());
+
System.setProperty(Log4jPropertyKey.ASYNC_LOGGER_RING_BUFFER_SIZE.getSystemKey(),
"128"); // minimum ringbuffer size
+
System.setProperty(Log4jPropertyKey.CONTEXT_SELECTOR_CLASS_NAME.getSystemKey(),
AsyncLoggerContextSelector.class.getName());
GcFreeLoggingTestUtil.executeLogging("gcFreeLogging.xml",
GcFreeAsynchronousLoggingTest.class);
}
}
diff --git
a/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeLoggingTestUtil.java
b/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeLoggingTestUtil.java
index 0ad5cd399c..33696a71fb 100644
---
a/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeLoggingTestUtil.java
+++
b/log4j-gctests/src/test/java/org/apache/logging/log4j/gctests/GcFreeLoggingTestUtil.java
@@ -221,15 +221,15 @@ public enum GcFreeLoggingTestUtil {;
final String javaBin = javaHome + File.separator + "bin" +
File.separator + "java";
final String classpath = getProperty("java.class.path");
final String javaagent = "-javaagent:" + agentJar();
- final String usePreciseClock =
System.getProperty("log4j2.usePreciseClock");
+ final String usePreciseClock =
System.getProperty(Log4jPropertyKey.USE_PRECISE_CLOCK.getSystemKey());
final File tempFile = File.createTempFile("allocations", ".txt");
- tempFile.deleteOnExit();
+ //tempFile.deleteOnExit();
List<String> command = new ArrayList<>();
command.add(javaBin);
command.add(javaagent);
if (usePreciseClock != null) {
- command.add("-Dlog4j2.usePreciseClock=" + usePreciseClock);
+ command.add("-D" +
Log4jPropertyKey.USE_PRECISE_CLOCK.getSystemKey() + "=" + usePreciseClock);
}
command.add("-cp");
command.add(classpath);
diff --git
a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
deleted file mode 100644
index 24f40d5a2c..0000000000
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.logging.log4j.jul;
-
-/**
- * Constants for the JUL adapter.
- *
- * @since 2.1
- */
-public final class Constants {
-
- /**
- * Name of the Log4j property to set to override the {@link
AbstractLoggerAdapter} to be used. By
- * default, when this property is not set, an appropriate LoggerAdaptor is
chosen based on the presence of
- * {@code log4j-core}.
- */
- public static final String LOGGER_ADAPTOR_PROPERTY =
"log4j.jul.LoggerAdapter";
-
- /**
- * The Log4j property to set to a custom implementation of {@link
org.apache.logging.log4j.jul.LevelConverter}. The specified class must have
- * a default constructor.
- */
- public static final String LEVEL_CONVERTER_PROPERTY =
"log4j.jul.levelConverter";
-
- static final String CORE_LOGGER_CLASS_NAME =
"org.apache.logging.log4j.core.Logger";
- static final String CORE_LOGGER_ADAPTER_CLASS_NAME =
"org.apache.logging.log4j.jul.CoreLoggerAdapter";
- static final String API_LOGGER_ADAPTER_CLASS_NAME =
"org.apache.logging.log4j.jul.ApiLoggerAdapter";
-
- private Constants() {
- }
-}
diff --git
a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/JulPropertyKey.java
b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/JulPropertyKey.java
new file mode 100644
index 0000000000..277451715a
--- /dev/null
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/JulPropertyKey.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.logging.log4j.jul;
+
+import org.apache.logging.log4j.spi.LoggingSystemProperty;
+import org.apache.logging.log4j.spi.PropertyComponent;
+import org.apache.logging.log4j.util.PropertyKey;
+
+/**
+ * Properties used by the JUL support.
+ */
+public enum JulPropertyKey implements PropertyKey {
+
+ LEVEL_CONVERTER(PropertyComponent.JUL, "levelConverter"),
+ LOGGER_ADAPTER(PropertyComponent.JUL, "loggerAdpater");
+
+ private final PropertyComponent component;
+ private final String name;
+ private final String key;
+ private final String systemKey;
+
+ JulPropertyKey(final PropertyComponent component, String name) {
+ this.component = component;
+ this.name = name;
+ this.key = component.getName() + "." + name;
+ this.systemKey = LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX + key;
+ }
+
+ public static PropertyKey findKey(String component, String name) {
+ for (PropertyKey key : values()) {
+ if (key.getComponent().equals(component) &&
key.getName().equals(name)) {
+ return key;
+ }
+ }
+ return null;
+ }
+
+ public String getComponent() {
+ return component.getName();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public String getSystemKey() {
+ return systemKey;
+ }
+
+ public String toString() {
+ return getKey();
+ }
+
+
+
+}
diff --git
a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelConverter.java
b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelConverter.java
index 54abe24823..ff13dbe5e4 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelConverter.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelConverter.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.Level;
* Strategy interface to convert between custom Log4j {@link Level Levels} and
JUL
* {@link java.util.logging.Level Levels}.
*
- * @see Constants#LEVEL_CONVERTER_PROPERTY
+ * @see JulPropertyKey#LEVEL_CONVERTER
* @since 2.1
*/
public interface LevelConverter {
diff --git
a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelTranslator.java
b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelTranslator.java
index 8b40d629cf..bbe40e28e0 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelTranslator.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LevelTranslator.java
@@ -46,7 +46,7 @@ public final class LevelTranslator {
static {
final String levelConverterClassName =
-
PropertiesUtil.getProperties().getStringProperty(Constants.LEVEL_CONVERTER_PROPERTY);
+
PropertiesUtil.getProperties().getStringProperty(JulPropertyKey.LEVEL_CONVERTER);
if (levelConverterClassName != null) {
LevelConverter levelConverter;
try {
diff --git
a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LogManager.java
b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LogManager.java
index 0a6462209e..96ed06c466 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LogManager.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/LogManager.java
@@ -42,6 +42,9 @@ import org.apache.logging.log4j.util.PropertiesUtil;
public class LogManager extends java.util.logging.LogManager {
private static final org.apache.logging.log4j.Logger LOGGER =
StatusLogger.getLogger();
+ private static final String CORE_LOGGER_CLASS_NAME =
"org.apache.logging.log4j.core.Logger";
+ private static final String CORE_LOGGER_ADAPTER_CLASS_NAME =
"org.apache.logging.log4j.jul.CoreLoggerAdapter";
+ private static final String API_LOGGER_ADAPTER_CLASS_NAME =
"org.apache.logging.log4j.jul.ApiLoggerAdapter";
private final AbstractLoggerAdapter loggerAdapter;
// Contains the set of logger names that are actively being requested
using getLogger.
private final ThreadLocal<Set<String>> recursive =
ThreadLocal.withInitial(HashSet::new);
@@ -50,7 +53,7 @@ public class LogManager extends java.util.logging.LogManager {
super();
AbstractLoggerAdapter adapter = null;
final String overrideAdaptorClassName =
-
PropertiesUtil.getProperties().getStringProperty(Constants.LOGGER_ADAPTOR_PROPERTY);
+
PropertiesUtil.getProperties().getStringProperty(JulPropertyKey.LOGGER_ADAPTER);
if (overrideAdaptorClassName != null) {
try {
LOGGER.info("Trying to use LoggerAdaptor [{}] specified by
Log4j property.", overrideAdaptorClassName);
@@ -64,10 +67,10 @@ public class LogManager extends
java.util.logging.LogManager {
String adapterClassName;
try {
// find out if log4j-core is available
- LoaderUtil.loadClass(Constants.CORE_LOGGER_CLASS_NAME);
- adapterClassName = Constants.CORE_LOGGER_ADAPTER_CLASS_NAME;
+ LoaderUtil.loadClass(CORE_LOGGER_CLASS_NAME);
+ adapterClassName = CORE_LOGGER_ADAPTER_CLASS_NAME;
} catch (final ClassNotFoundException ignored) {
- adapterClassName = Constants.API_LOGGER_ADAPTER_CLASS_NAME;
+ adapterClassName = API_LOGGER_ADAPTER_CLASS_NAME;
}
LOGGER.debug("Attempting to use {}", adapterClassName);
try {
diff --git a/log4j-jul/src/main/resources/log4j2.propertyMapping.json
b/log4j-jul/src/main/resources/log4j2.propertyMapping.json
index 4b6321bc93..0f2c4dbf47 100644
--- a/log4j-jul/src/main/resources/log4j2.propertyMapping.json
+++ b/log4j-jul/src/main/resources/log4j2.propertyMapping.json
@@ -1,8 +1,14 @@
{
"log4j2": {
+ "julLevelConverter": ["JUL", "levelConverter"],
"julLoggerAdapter": ["JUL", "loggerAdapter"]
},
+ "log4j": {
+ "jul.loggerAdapter": ["JUL", "loggerAdapter"],
+ "jul.levelConverter": ["JUL", "levelConverter"]
+ },
"LOG4J": {
+ "JUL_LEVEL_CONVERTER": ["JUL", "levelConverter"],
"JUL_LOGGER_ADAPTER": ["JUL", "loggerAdapter"]
}
}
\ No newline at end of file
diff --git
a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/test/ApiLoggerTest.java
b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/test/ApiLoggerTest.java
index 8dc968cd6e..17e9d1c744 100644
---
a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/test/ApiLoggerTest.java
+++
b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/test/ApiLoggerTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.jul.test;
import java.util.logging.Logger;
import org.apache.logging.log4j.jul.ApiLoggerAdapter;
-import org.apache.logging.log4j.jul.Constants;
+import org.apache.logging.log4j.jul.JulPropertyKey;
import org.apache.logging.log4j.jul.LogManager;
import org.junit.After;
import org.junit.AfterClass;
@@ -37,13 +37,13 @@ public class ApiLoggerTest extends AbstractLoggerTest {
@BeforeClass
public static void setUpClass() {
System.setProperty("java.util.logging.manager",
LogManager.class.getName());
- System.setProperty(Constants.LOGGER_ADAPTOR_PROPERTY,
ApiLoggerAdapter.class.getName());
+ System.setProperty(JulPropertyKey.LOGGER_ADAPTER.getSystemKey(),
ApiLoggerAdapter.class.getName());
}
@AfterClass
public static void tearDownClass() {
System.clearProperty("java.util.logging.manager");
- System.clearProperty(Constants.LOGGER_ADAPTOR_PROPERTY);
+ System.clearProperty(JulPropertyKey.LOGGER_ADAPTER.getSystemKey());
}
@Before
diff --git
a/log4j-script/src/main/java/org/apache/logging/log4j/script/ScriptManagerImpl.java
b/log4j-script/src/main/java/org/apache/logging/log4j/script/ScriptManagerImpl.java
index a47b6c6330..611eb6adad 100644
---
a/log4j-script/src/main/java/org/apache/logging/log4j/script/ScriptManagerImpl.java
+++
b/log4j-script/src/main/java/org/apache/logging/log4j/script/ScriptManagerImpl.java
@@ -40,7 +40,6 @@ import javax.script.SimpleBindings;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.script.Script;
import org.apache.logging.log4j.core.script.ScriptBindings;
import org.apache.logging.log4j.core.script.ScriptManager;
@@ -86,7 +85,7 @@ public class ScriptManagerImpl implements ScriptManager,
FileWatcher {
public ScriptManagerImpl(final Configuration configuration, final
WatchManager watchManager) {
String scriptLanguages =
-
PropertiesUtil.getProperties().getStringProperty(Log4jPropertyKey.SCRIPT_ENABLE_LANGUAGES);
+
PropertiesUtil.getProperties().getStringProperty(ScriptPropertyKey.SCRIPT_ENABLE_LANGUAGES);
this.configuration = configuration;
this.watchManager = watchManager;
final List<ScriptEngineFactory> factories =
manager.getEngineFactories();
diff --git
a/log4j-script/src/main/java/org/apache/logging/log4j/script/ScriptPropertyKey.java
b/log4j-script/src/main/java/org/apache/logging/log4j/script/ScriptPropertyKey.java
new file mode 100644
index 0000000000..123bbb6d63
--- /dev/null
+++
b/log4j-script/src/main/java/org/apache/logging/log4j/script/ScriptPropertyKey.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.logging.log4j.script;
+
+import org.apache.logging.log4j.spi.LoggingSystemProperty;
+import org.apache.logging.log4j.spi.PropertyComponent;
+import org.apache.logging.log4j.util.PropertyKey;
+
+/**
+ * Properties used by the JUL support.
+ */
+public enum ScriptPropertyKey implements PropertyKey {
+
+ SCRIPT_ENABLE_LANGUAGES(PropertyComponent.SCRIPT,
ScriptPropertyKey.Constant.ENABLE_LANGUAGES);
+
+ private final PropertyComponent component;
+ private final String name;
+ private final String key;
+ private final String systemKey;
+
+ ScriptPropertyKey(final PropertyComponent component, String name) {
+ this.component = component;
+ this.name = name;
+ this.key = component.getName() + "." + name;
+ this.systemKey = LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX + key;
+ }
+
+ public static PropertyKey findKey(String component, String name) {
+ for (PropertyKey key : values()) {
+ if (key.getComponent().equals(component) &&
key.getName().equals(name)) {
+ return key;
+ }
+ }
+ return null;
+ }
+
+ public String getComponent() {
+ return component.getName();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public String getSystemKey() {
+ return systemKey;
+ }
+
+ public String toString() {
+ return getKey();
+ }
+
+ public static class Constant {
+ private static final String DELIM = ".";
+ static final String ENABLE_LANGUAGES = "enableLanguages";
+ public static final String SCRIPT_ENABLE_LANGUAGES =
LoggingSystemProperty.SYSTEM_PROPERTY_PREFIX
+ + PropertyComponent.Constant.SCRIPT + DELIM + ENABLE_LANGUAGES;
+ }
+
+}
diff --git
a/log4j-script/src/main/java/org/apache/logging/log4j/script/factory/ScriptManagerFactoryImpl.java
b/log4j-script/src/main/java/org/apache/logging/log4j/script/factory/ScriptManagerFactoryImpl.java
index 2093dce89d..2e54ee5479 100644
---
a/log4j-script/src/main/java/org/apache/logging/log4j/script/factory/ScriptManagerFactoryImpl.java
+++
b/log4j-script/src/main/java/org/apache/logging/log4j/script/factory/ScriptManagerFactoryImpl.java
@@ -18,11 +18,11 @@ package org.apache.logging.log4j.script.factory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.script.ScriptManager;
import org.apache.logging.log4j.core.script.ScriptManagerFactory;
import org.apache.logging.log4j.core.util.WatchManager;
import org.apache.logging.log4j.script.ScriptManagerImpl;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.util.PropertiesUtil;
@@ -34,7 +34,8 @@ public class ScriptManagerFactoryImpl implements
ScriptManagerFactory {
@Override
public ScriptManager createScriptManager(Configuration configuration,
WatchManager watchManager) {
- String scriptLanguages =
PropertiesUtil.getProperties().getStringProperty(Log4jPropertyKey.SCRIPT_ENABLE_LANGUAGES);
+ String scriptLanguages =
+
PropertiesUtil.getProperties().getStringProperty(ScriptPropertyKey.SCRIPT_ENABLE_LANGUAGES);
if (scriptLanguages != null) {
try {
return new ScriptManagerImpl(configuration, watchManager);
diff --git a/log4j-script/src/main/module/module-info.java
b/log4j-script/src/main/module/module-info.java
index df254be3a9..048c1e0c1d 100644
--- a/log4j-script/src/main/module/module-info.java
+++ b/log4j-script/src/main/module/module-info.java
@@ -32,6 +32,7 @@ module org.apache.logging.log4j.script {
exports org.apache.logging.log4j.script.layout;
opens org.apache.logging.log4j.script.layout to
org.apache.logging.log4j.core;
+ exports org.apache.logging.log4j.script.plugins;
requires org.apache.logging.log4j;
requires org.apache.logging.log4j.core;
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/ScriptAppenderSelectorTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/ScriptAppenderSelectorTest.java
index 9d87fa3dfd..40121158f2 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/ScriptAppenderSelectorTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/ScriptAppenderSelectorTest.java
@@ -18,9 +18,9 @@ package org.apache.logging.log4j.script.appender;
import org.apache.logging.log4j.MarkerManager;
import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.appender.ListAppender;
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.apache.logging.log4j.spi.ExtendedLogger;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
@@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.hasSize;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
public class ScriptAppenderSelectorTest {
@Test
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
index 51b8d8fb68..1081240689 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
@@ -27,8 +27,8 @@ import java.util.function.LongSupplier;
import java.util.stream.Stream;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.junit.LoggerContextRule;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.assertj.core.api.ThrowingConsumer;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -49,7 +49,7 @@ public class RollingAppenderDeleteScriptFri13thTest {
@BeforeClass
public static void beforeClass() {
-
System.setProperty(Log4jPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
+
System.setProperty(ScriptPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
}
@Rule
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptTest.java
index 2bab7b9e90..f77be9a28b 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptTest.java
@@ -19,8 +19,8 @@ package org.apache.logging.log4j.script.appender.rolling;
import java.io.File;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.junit.LoggerContextRule;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
@@ -41,7 +41,7 @@ public class RollingAppenderDeleteScriptTest {
@BeforeClass
public static void beforeClass() {
-
System.setProperty(Log4jPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
+
System.setProperty(ScriptPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
}
@Rule
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptConditionTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptConditionTest.java
index 99f8986205..f7d98caed8 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptConditionTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptConditionTest.java
@@ -24,9 +24,9 @@ import java.util.List;
import
org.apache.logging.log4j.core.appender.rolling.action.PathWithAttributes;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.DefaultConfiguration;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import
org.apache.logging.log4j.core.test.appender.rolling.action.DummyFileAttributes;
import org.apache.logging.log4j.script.ScriptPlugin;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.SetSystemProperty;
@@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.*;
/**
* Tests the ScriptCondition class.
*/
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "js, javascript, groovy")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "js, javascript, groovy")
public class ScriptConditionTest {
@Test
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/DefaultRouteScriptAppenderTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/DefaultRouteScriptAppenderTest.java
index 7f11cae90f..d5ae84d694 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/DefaultRouteScriptAppenderTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/DefaultRouteScriptAppenderTest.java
@@ -24,9 +24,9 @@ import org.apache.logging.log4j.MarkerManager;
import org.apache.logging.log4j.core.Logger;
import org.apache.logging.log4j.core.appender.routing.RoutingAppender;
import org.apache.logging.log4j.core.config.AppenderControl;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.appender.ListAppender;
import org.apache.logging.log4j.core.test.junit.LoggerContextRule;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -57,7 +57,7 @@ public class DefaultRouteScriptAppenderTest {
@BeforeClass
public static void beforeClass() {
-
System.setProperty(Log4jPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
+
System.setProperty(ScriptPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
}
@Rule
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/RoutesScriptAppenderTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/RoutesScriptAppenderTest.java
index 518f81bec2..83d81c2f93 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/RoutesScriptAppenderTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/routing/RoutesScriptAppenderTest.java
@@ -29,10 +29,10 @@ import
org.apache.logging.log4j.core.appender.routing.Routes;
import org.apache.logging.log4j.core.appender.routing.RoutingAppender;
import org.apache.logging.log4j.core.config.AppenderControl;
import org.apache.logging.log4j.core.impl.DefaultLogEventFactory;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.appender.ListAppender;
import org.apache.logging.log4j.core.test.categories.Scripts;
import org.apache.logging.log4j.core.test.junit.LoggerContextRule;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -62,7 +62,7 @@ public class RoutesScriptAppenderTest {
@BeforeClass
public static void beforeClass() {
-
System.setProperty(Log4jPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
+
System.setProperty(ScriptPropertyKey.SCRIPT_ENABLE_LANGUAGES.getSystemKey(),
"Groovy, Javascript");
}
@Rule
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/config/TestConfigurator.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/config/TestConfigurator.java
index 43ec9bcca9..567df224b5 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/config/TestConfigurator.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/config/TestConfigurator.java
@@ -26,7 +26,7 @@ import
org.apache.logging.log4j.core.config.builder.api.AppenderComponentBuilder
import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilder;
import
org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilderFactory;
import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.SetSystemProperty;
@@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* Test Configuration
*/
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "beanshell, Groovy, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "beanshell, Groovy, Javascript")
public class TestConfigurator {
@Test
public void testBuilderWithScripts() throws Exception {
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/config/arbiter/ScriptArbiterTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/config/arbiter/ScriptArbiterTest.java
index 491699961f..6d5b9cba97 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/config/arbiter/ScriptArbiterTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/config/arbiter/ScriptArbiterTest.java
@@ -20,8 +20,8 @@ import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.appender.ConsoleAppender;
import org.apache.logging.log4j.core.config.Configurator;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.appender.ListAppender;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.SetSystemProperty;
@@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Tests basic condition processing.
*/
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
public class ScriptArbiterTest {
static final String CONFIG = "log4j2-scriptArbiters.xml";
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterPropertiesTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterPropertiesTest.java
index 41f40be9ae..5f16115bb1 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterPropertiesTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterPropertiesTest.java
@@ -16,12 +16,12 @@
*/
package org.apache.logging.log4j.script.filter;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
import org.apache.logging.log4j.core.test.junit.ReconfigurationPolicy;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junitpioneer.jupiter.SetSystemProperty;
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
@LoggerContextSource(value = "log4j-scriptFile-filters.properties",
reconfigure = ReconfigurationPolicy.BEFORE_EACH)
public class ScriptFileFilterPropertiesTest extends AbstractScriptFilterTest {
}
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterTest.java
index 8b4399ffc0..fc29ef3440 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFileFilterTest.java
@@ -16,12 +16,12 @@
*/
package org.apache.logging.log4j.script.filter;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
import org.apache.logging.log4j.core.test.junit.ReconfigurationPolicy;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junitpioneer.jupiter.SetSystemProperty;
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
@LoggerContextSource(value = "log4j-scriptFile-filters.xml", reconfigure =
ReconfigurationPolicy.BEFORE_EACH)
public class ScriptFileFilterTest extends AbstractScriptFilterTest {
}
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFilterTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFilterTest.java
index b7f183d255..0f667fec9c 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFilterTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptFilterTest.java
@@ -16,12 +16,12 @@
*/
package org.apache.logging.log4j.script.filter;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
import org.apache.logging.log4j.core.test.junit.ReconfigurationPolicy;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junitpioneer.jupiter.SetSystemProperty;
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
@LoggerContextSource(value = "log4j-script-filters.xml", reconfigure =
ReconfigurationPolicy.BEFORE_EACH)
public class ScriptFilterTest extends AbstractScriptFilterTest {
}
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptRefFilterTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptRefFilterTest.java
index 74ee404988..f3ea8b5ea4 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptRefFilterTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/filter/ScriptRefFilterTest.java
@@ -16,12 +16,12 @@
*/
package org.apache.logging.log4j.script.filter;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
import org.apache.logging.log4j.core.test.junit.ReconfigurationPolicy;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.junitpioneer.jupiter.SetSystemProperty;
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "Groovy, Javascript")
@LoggerContextSource(value = "log4j-scriptRef-filters.xml", reconfigure =
ReconfigurationPolicy.BEFORE_EACH)
public class ScriptRefFilterTest extends AbstractScriptFilterTest {
}
diff --git
a/log4j-script/src/test/java/org/apache/logging/log4j/script/layout/PatternSelectorTest.java
b/log4j-script/src/test/java/org/apache/logging/log4j/script/layout/PatternSelectorTest.java
index f5226c1835..7f3ddc1672 100644
---
a/log4j-script/src/test/java/org/apache/logging/log4j/script/layout/PatternSelectorTest.java
+++
b/log4j-script/src/test/java/org/apache/logging/log4j/script/layout/PatternSelectorTest.java
@@ -19,11 +19,11 @@ package org.apache.logging.log4j.script.layout;
import java.util.List;
import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
import org.apache.logging.log4j.core.test.appender.ListAppender;
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
import org.apache.logging.log4j.core.test.junit.Named;
import org.apache.logging.log4j.core.test.junit.ReconfigurationPolicy;
+import org.apache.logging.log4j.script.ScriptPropertyKey;
import org.apache.logging.log4j.util.Strings;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.SetSystemProperty;
@@ -31,7 +31,7 @@ import org.junitpioneer.jupiter.SetSystemProperty;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-@SetSystemProperty(key = Log4jPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "bsh, Javascript")
+@SetSystemProperty(key = ScriptPropertyKey.Constant.SCRIPT_ENABLE_LANGUAGES,
value = "bsh, Javascript")
@LoggerContextSource(value = "log4j-patternSelector.xml", reconfigure =
ReconfigurationPolicy.BEFORE_EACH)
public class PatternSelectorTest {
diff --git a/src/site/asciidoc/manual/configuration.adoc
b/src/site/asciidoc/manual/configuration.adoc
index 3106622e93..e3bc3fa974 100644
--- a/src/site/asciidoc/manual/configuration.adoc
+++ b/src/site/asciidoc/manual/configuration.adoc
@@ -1845,840 +1845,3 @@ public class AwesomeTest {
}
----
-[#SystemProperties]
-== System Properties
-
-The Log4j documentation references a number of System Properties that
-can be used to control various aspects of Log4j 2 behavior. The table
-below lists these properties along with their default value and a
-description of what they control. Any spaces present in the property
-name are for visual flow and should be removed.
-
-Note that beginning in Log4j 2.10, all system property names have been
-normalized to follow a consistent naming scheme. While the old property
-names are still supported for backwards compatibility, it is recommended
-to update configurations to use the new style. This system is extensible
-and is enabled through the
-link:../log4j-api/apidocs/org/apache/logging/log4j/util/PropertySource.html[`PropertySource`]
-interface. Additional property source classes can be added through the
-standard `ServiceLoader` mechanism in Java SE.
-
-Properties can be overridden by sources with a lower number priority
-(e.g.., -100 comes before 100). The following sources are all available
-by default:
-
-.PropertySource priorities and descriptions
-[cols="2,1,5"]
-|===
-|Source |Priority |Description
-
-|Spring Boot Properties
-|-100
-|This property source is enabled only if the Java application uses Spring Boot
and the
-`log4j-spring` module is present. It resolves properties using a Spring
-link:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/Environment.html[Environment].
-
-|System Properties
-|0
-|All properties can be set using normal system
-property patterns. These have the lowest numerical priority among commonly
available property sources
-and can override included `log4j2.component.properties` files or environment
variables. If a `log4j2.system.properties` file is available on the classpath
its contents are
-sourced into Java system properties at Log4j startup.
-
-|Environment Variables
-|100
-|Environment variables are all prefixed
-with `LOG4J_`, are in all caps, and words are all separated by
-underscores. Only this naming scheme is support for environment
-variables as there were no old naming schemes to maintain compatibility
-with.
-
-|`log4j2.component.properties` file
-|200
-|Including this file on the classpath can be used as an alternative to
providing properties as system
-properties. This is the property source with highest numerical priority and
can be used to provide
-default values that can be overridden by the system administrator.
-|===
-
-The following is a list of available global configuration properties.
-Note that these can only be set once per JVM process unlike
-configuration settings available in configuration files. The _Property
-Name_ column contains the name used in properties files and system
-properties; _Environment Variable_ for the equivalent environment
-variable; and _Legacy Property Name_ for the pre-2.10 name.
-
-.Log4j 2 global configuration properties
-[cols="3*,a"]
-|===
-|Property Name (Legacy Property Name) |Environment Variable |Default Value
|Description
-
-|[[configurationFile]]log4j2.configurationFile +
-([[log4j.configurationFile]]log4j.configurationFile)
-|LOG4J_CONFIGURATION_FILE
-|
-|Path to an Log4j 2 configuration file. May
-also contain a comma separated list of configuration file names. May contain a
URL.
-When specified as a URL the "override" query parameter may be used to specify
additional
-configuration file locations.
-
-|[[debug]]log4j2.debug +
-([[log4j2.debug]]log4j2.debug)
-|LOG4J_DEBUG
-|
-|Log4j2 will print all
-internal logging to the console if system property `log4j2.debug` is either
-defined empty or its value equals to `true` (ignoring case).
-
-|[[mergeStrategy]]log4j2.mergeStrategy +
-([[log4j.mergeStrategy]]log4j.mergeStrategy)
-|LOG4J_MERGE_STRATEGY
-|
-|The name of the class that implements the MergeStrategy interface. If not
-specified `DefaultMergeStrategy` will be used when creating a
CompositeConfiguration.
-
-|[[contextSelector]]log4j2.contextSelector +
-([[Log4jContextSelector]]Log4jContextSelector)
-|LOG4J_CONTEXT_SELECTOR
-|ClassLoaderContextSelector
-|Creates the `LoggerContext`s. An
-application can have one or more active LoggerContexts depending on the
-circumstances. See link:logsep.html[Log Separation] for more details.
-Available context selector implementation classes: +
-`org.apache.logging.log4j.core.async .AsyncLoggerContextSelector` -
-makes link:async.html[all loggers asynchronous]. +
-`org.apache.logging.log4j.core.async .BasicAsyncLoggerContextSelector` -
-makes link:async.html[all loggers asynchronous] using a single shared
-AsyncLoggerContext. +
-`org.apache.logging.log4j.core.selector .BasicContextSelector` - creates
-a single shared LoggerContext. +
-`org.apache.logging.log4j.core.selector .ClassLoaderContextSelector` -
-separate LoggerContexts for each web application. +
-`org.apache.logging.log4j.core.selector .JndiContextSelector` - use JNDI
-to locate each web application's LoggerContext. +
-`org.apache.logging.log4j.core.osgi .BundleContextSelector` - separate
-LoggerContexts for each OSGi bundle.
-
-|[[logEventFactory]]log4j2.logEventFactory +
-([[Log4jLogEventFactory]]Log4jLogEventFactory)
-|LOG4J_LOG_EVENT_FACTORY
-|org.apache.logging.log4j.core.impl .DefaultLogEventFactory
-|Factory class used by LoggerConfig to create `LogEvent` instances. (Ignored
when
-the `AsyncLoggerContextSelector` is used.)
-
-|[[loggerContextFactory]]log4j2.loggerContextFactory +
-([[log4j2.loggerContextFactory]]log4j2.loggerContextFactory)
-|LOG4J_LOGGER_CONTEXT_FACTORY
-|org.apache.logging.log4j.simple
-.SimpleLoggerContextFactory
-|Factory class used by LogManager to
-bootstrap the logging implementation. The core jar provides
-`org.apache.logging.log4j.core .impl.Log4jContextFactory`.
-
-|[[configurationFactory]]log4j2.configurationFactory +
-([[log4j.configurationFactory]]log4j.configurationFactory)
-|LOG4J_CONFIGURATION_FACTORY
-|
-|Fully specified class name of a class
-extending
-`org.apache.logging.log4j.core .config.ConfigurationFactory`.
-If specified, an instance of this class is added to the list of
-configuration factories.
-
-|[[configurationAllowedProtocols]]log4j2.Configuration.allowedProtocols +
-([[log4j.configurationAllowedProtocols]]log4j.configurationAllowedProtocols)
-|LOG4J_CONFIGURATION_ALLOWED_PROTOCOLS
-|
-|A comma separated list of the protocols that may be used to load a
configuration file. The default is https.
-To completely prevent accessing the configuration via a URL specify a value of
"_none".
-
-|[[configurationAuthorizationProvider]]log4j2.Configuration.authorizationProvider
+
-([[log4j.configurationAuthorizationProvider]]log4j.configurationAuthorizationProvider)
-|LOG4J_CONFIGURATION_AUTHORIZATION_PROVIDER
-|org.apache.logging.log4j.core.util.BasicAuthorizationProvider
-|The fully qualified class name of the AuthorizationProvider.
-
-|[[configurationPassword]]log4j2.Configuration.password +
-([[log4j.configurationPassword]]log4j.configurationPassword)
-|LOG4J_CONFIGURATION_PASSWORD
-|
-|The password required to access the remote logging configuration file.
-
-|[[configurationPasswordDecryptor]]log4j2.Configuration.passwordDecryptor +
-([[log4j.configurationPasswordDecryptor]]log4j.configurationPasswordDecryptor)
-|LOG4J_CONFIGURATION_DECRYPTOR
-|
-|If the password is encrypted this class will be used to decrypt it.
-
-|[[configurationUsername]]log4j2.Configuration.username+
-([[log4j.configurationUsername]]log4j.configurationUsername)
-|LOG4J_CONFIGURATION_USERNAME
-|
-|The user name required to access the remote logging configuration file.
-
-|[[shutdownHookEnabled]]log4j2.shutdownHookEnabled +
-([[log4j.shutdownHookEnabled]]log4j.shutdownHookEnabled)
-|LOG4J_SHUTDOWN_HOOK_ENABLED
-|true
-|Overrides the global flag for
-whether or not a shutdown hook should be used to stop a
-`LoggerContext`. By default, this is enabled and can be
-disabled on a per-configuration basis. When running with the `log4j-web`
-module, this is automatically disabled.
-
-|[[shutdownCallbackRegistry]]log4j2.shutdownCallbackRegistry +
-([[log4j.shutdownCallbackRegistry]]log4j.shutdownCallbackRegistry)
-|LOG4J_SHUTDOWN_CALLBACK_REGISTRY
-|org.apache.logging.log4j.core.util
-.DefaultShutdownCallbackRegistry
-|Fully specified class name of a class implementing
-link:../log4j-core/apidocs/org/apache/logging/log4j/core/util/ShutdownCallbackRegistry.html[ShutdownCallbackRegistry].
-If specified, an instance of this class is used instead of
-`DefaultShutdownCallbackRegistry`. The specified class must have a
-default constructor.
-
-|[[clock]]log4j2.clock +
-([[log4j.Clock]]log4j.Clock)
-|LOG4J_CLOCK
-|SystemClock
-|Implementation
-of the `org.apache.logging.log4j .core.time.Clock` interface that is
-used for timestamping the log events. +
-By default, `System.currentTimeMillis` is called on every log event. +
-You can also specify a fully qualified class name of a custom class that
-implements the `Clock` interface.
-
-|[[usePreciseClock]]log4j2.usePreciseClock
-|LOG4J_USE_PRECISE_CLOCK
-|false
-|When false the clock resolution will be in milliseconds. When true it will
use the smallest granularity supported by
-the JVM. The precise clock is not garbage free. This setting only applies when
Log4j's default SystemClock is used.
-
-|[[level]]log4j2.level +
-([[org.apache.logging.log4j.level]]org.apache.logging.log4j.level)
-|LOG4J_LEVEL
-|ERROR
-|Log level of the default configuration. The default
-configuration is used if the ConfigurationFactory could not successfully
-create a configuration (e.g. no log4j2.xml file was found).
-
-|[[disableThreadContext]]log4j2.disableThreadContext +
-(disableThreadContext)
-|LOG4J_DISABLE_THREAD_CONTEXT
-|false
-|If `true`,
-the ThreadContext stack and map are disabled. (May be ignored if a
-custom ThreadContext map is specified.)
-
-|[[disableThreadContextStack]]log4j2.disableThreadContextStack +
-(disableThreadContextStack)
-|LOG4J_DISABLE_THREAD_CONTEXT_STACK
-|false
-|If `true`, the ThreadContext stack is disabled.
-
-|[[disableThreadContextMap]]log4j2.disableThreadContextMap +
-(disableThreadContextMap)
-|LOG4J_DISABLE_THREAD_CONTEXT_MAP
-|false
-|If
-`true`, the ThreadContext map is disabled. (May be ignored if a custom
-ThreadContext map is specified.)
-
-|[[log4j2.threadContextMap]]log4j2.threadContextMap +
-(log4j2.threadContextMap)
-|LOG4J_THREAD_CONTEXT_MAP
-|
-|Fully specified
-class name of a custom `ThreadContextMap` implementation class.
-
-|[[isThreadContextMapInheritable]]log4j2.isThreadContextMapInheritable +
-(isThreadContextMapInheritable)
-|LOG4J_IS_THREAD_CONTEXT_MAP_INHERITABLE
-|false
-|If `true` use a `InheritableThreadLocal` to implement the
-ThreadContext map. Otherwise, use a plain `ThreadLocal`. (May be ignored
-if a custom ThreadContext map is specified.)
-
-|[[contextDataInjector]]log4j2.contextDataInjector +
-([[log4j2.ContextDataInjector]]log4j2.ContextDataInjector)
-|LOG4J_CONTEXT_DATA_INJECTOR
-|
-|Fully specified class name of a custom
-`ContextDataInjector` implementation class.
-
-|[[garbagefreeThreadContextMap]]log4j2.garbagefreeThreadContextMap +
-([[log4j2.garbagefree.threadContextMap]]log4j2.garbagefree.threadContextMap)
-|LOG4J_GARBAGEFREE_THREAD_CONTEXT_MAP
-|false
-|Specify "true" to make the
-ThreadContext map garbage-free.
-
-|[[disableJmx]]log4j2.disableJmx +
-([[log4j2.disable.jmx]]log4j2.disable.jmx)
-|LOG4J_DISABLE_JMX
-|false
-|If
-`true`, Log4j configuration objects like LoggerContexts, Appenders,
-Loggers, etc. will not be instrumented with MBeans and cannot be
-remotely monitored and managed.
-
-|[[jmxNotifyAsync]]log4j2.jmxNotifyAsync +
-([[log4j2.jmx.notify.async]]log4j2.jmx.notify.async)
-|LOG4J_JMX_NOTIFY_ASYNC
-|false for web apps, true otherwise
-|If `true`,
-log4j's JMX notifications are sent from a separate background thread,
-otherwise they are sent from the caller thread. If system property
-`log4j2.is.webapp` is `true` or the `javax.servlet.Servlet` class is on
-the classpath, the default behaviour is to use the caller thread to send
-JMX notifications.
-
-|[[skipJansi]]log4j2.skipJansi +
-([[log4j.skipJansi]]log4j.skipJansi)
-|LOG4J_SKIP_JANSI
-|true
-|If `true`,
-the ConsoleAppender will not try to use the Jansi output stream on
-Windows.
-
-|[[ignoreTCL]]log4j2.ignoreTCL +
-([[log4j.ignoreTCL]]log4j.ignoreTCL)
-|LOG4J_IGNORE_TCL
-|false
-|If
-`true`, classes are only loaded with the default class loader.
-Otherwise, an attempt is made to load classes with the current thread's
-context class loader before falling back to the default class loader.
-
-
-|[[forceTCLOnly]]log4j2.forceTCLOnly +
-([[log4j.forceTCLOnly]]log4j.forceTCLOnly)
-|LOG4J_FORCE_TCL_ONLY
-|false
-|If `true`, classes and configuration are only loaded with the default context
class loader.
-Otherwise, log4j also uses the log4j classloader, parent classloaders and the
system classloader.
-
-|[[enableJndi]]log4j2.enableJndi +
-([[log4j.enableJndi]]log4j.enableJndi)
-|LOG4J_ENABLE_JNDI
-|false
-| When true, Log4j components that use JNDI are enabled. When false, the
default, they are disabled.
-
-|[[allowedLdapClasses]]log4j2.allowedLdapClasses +
-([[log4j.allowedLdapClasses]]log4j.allowedLdapClasses)
-|LOG4J_ALLOWED_LDAP_CLASSES
-|
-| System property that specifies fully qualified class names that may be
accessed by LDAP. The classes
-must implement Serializable. By default only Java primative classes are
allowed.
-
-|[[allowedLdapHosts]]log4j2.allowedLdapHosts +
-([[log4j.allowedLdapHosts]]log4j.allowedLdapHosts)
-|LOG4J_ALLOWED_LDAP_HOSTS
-|
-| System property that adds host names or ip addresses that may be access by
LDAP. By default it only allows
-the local host names and ip addresses.
-
-|[[allowedJndiProtocols]]log4j2.allowedJndiProtocols +
-([[log4j.allowedJndiProtocols]]log4j.allowedJndiProtocols)
-|LOG4J_ALLOWED_JNDI_PROTOCOLS
-|
-| System property that adds protocol names that JNDI will allow. By default it
only allows java, ldap, and ldaps.
-
-|[[uuidSequence]]log4j2.uuidSequence +
-([[org.apache.logging.log4j.uuidSequence]]org.apache.logging.log4j.uuidSequence)
-|LOG4J_UUID_SEQUENCE
-|0
-|System property that may be used to seed the
-UUID generation with an integer value.
-
-|[[simplelogShowContextMap]]log4j2.simplelogShowContextMap +
-([[org.apache.logging.log4j.simplelog.showContextMap]]org.apache.logging.log4j
-.simplelog.showContextMap)
-|LOG4J_SIMPLELOG_SHOW_CONTEXT_MAP
-|false
-|If
-`true`, the full ThreadContext map is included in each SimpleLogger log
-message.
-
-|[[simplelogShowlogname]]log4j2.simplelogShowlogname +
-([[org.apache.logging.log4j.simplelog.showlogname]]org.apache.logging.log4j
-.simplelog.showlogname)
-|LOG4J_SIMPLELOG_SHOWLOGNAME
-|false
-|If `true`,
-the logger name is included in each SimpleLogger log message.
-
-|[[simplelogShowShortLogname]]log4j2.simplelogShowShortLogname +
-([[org.apache.logging.log4j.simplelog.showShortLogname]]org.apache.logging.log4j
-.simplelog.showShortLogname)
-|LOG4J_SIMPLELOG_SHOW_SHORT_LOGNAME
-|true
-|If `true`, only the last component of a logger name is included in
-SimpleLogger log messages. (E.g., if the logger name is
-"mycompany.myproject.mycomponent", only "mycomponent" is logged.
-
-|[[simplelogShowdatetime]]log4j2.simplelogShowdatetime +
-([[org.apache.logging.log4j.simplelog.showdatetime]]org.apache.logging.log4j
-.simplelog.showdatetime)
-|LOG4J_SIMPLELOG_SHOWDATETIME
-|false
-|If
-`true`, SimpleLogger log messages contain timestamp information.
-
-|[[simplelogDateTimeFormat]]log4j2.simplelogDateTimeFormat +
-([[org.apache.logging.log4j.simplelog.dateTimeFormat]]org.apache.logging.log4j
-.simplelog.dateTimeFormat)
-|LOG4J_SIMPLELOG_DATE_TIME_FORMAT
-|"yyyy/MM/dd HH:mm:ss:SSS zzz"
-|Date-time format to use. Ignored if
-`org.apache.logging.log4j .simplelog.showdatetime` is `false`.
-
-|[[simplelogLogFile]]log4j2.simplelogLogFile +
-([[org.apache.logging.log4j.simplelog.logFile]]org.apache.logging.log4j
-.simplelog.logFile)
-|LOG4J_SIMPLELOG_LOG_FILE
-|system.err
-|"system.err"
-(case-insensitive) logs to System.err, "system.out" (case-insensitive)
-logs to System.out, any other value is interpreted as a file name to
-save SimpleLogger messages to.
-
-|[[simplelogLevel]]log4j2.simplelogLevel +
-([[org.apache.logging.log4j.simplelog.level]]org.apache.logging.log4j
-.simplelog.level)
-|LOG4J_SIMPLELOG_LEVEL
-|ERROR
-|Default level for new
-SimpleLogger instances.
-
-|log4j2.simplelog.<loggerName>.level +
-([[org.apache.logging.log4j.simplelog.[loggerName]level]]org.apache.logging.log4j
-.simplelog.<loggerName>.level)
-|LOG4J_SIMPLELOG_<LOGGER_NAME>_LEVEL
-|SimpleLogger default log level
-|Log level for a the SimpleLogger
-instance with the specified name.
-
-|[[simplelogStatusLoggerLevel]]log4j2.simplelogStatusLoggerLevel +
-([[org.apache.logging.log4j.simplelog.StatusLogger.level]]org.apache.logging.log4j.simplelog
-.StatusLogger.level)
-|LOG4J_SIMPLELOG_STATUS_LOGGER_LEVEL
-|ERROR
-|This
-property is used to control the initial StatusLogger level, and can be
-overridden in code by calling
-`StatusLogger.getLogger() .setLevel(someLevel)`. Note that the
-StatusLogger level is only used to determine the status log output level
-until a listener is registered. In practice, a listener is registered
-when a configuration is found, and from that point onwards, status
-messages are only sent to the listeners (depending on their
-statusLevel).
-
-|[[defaultStatusLevel]]log4j2.defaultStatusLevel +
-([[Log4jDefaultStatusLevel]]Log4jDefaultStatusLevel)
-|LOG4J_DEFAULT_STATUS_LEVEL
-|ERROR
-|
-The StatusLogger logs events that occur in the logging system to the
-console. During configuration, AbstractConfiguration registers a
-StatusConsoleListener with the StatusLogger that may redirect status log
-events from the default console output to a file. The listener also
-supports fine-grained filtering. This system property specifies the
-default status log level for the listener to use if the configuration
-does not specify a status level.
-
-Note: this property is used by the log4j-core implementation only after
-a configuration file has been found.
-
-|[[statusLoggerLevel]]log4j2.statusLoggerLevel +
-([[log4j2.StatusLogger.level]]log4j2.StatusLogger.level)
-|LOG4J_STATUS_LOGGER_LEVEL
-|WARN
-|
-The initial "listenersLevel" of the StatusLogger. If StatusLogger
-listeners are added, the "listenerLevel" is changed to that of the most
-verbose listener. If any listeners are registered, the listenerLevel is
-used to quickly determine if an interested listener exists.
-
-By default, StatusLogger listeners are added when a configuration is
-found and by the JMX StatusLoggerAdmin MBean. For example, if a
-configuration contains `<Configuration status="trace">`, a listener with
-statusLevel TRACE is registered and the StatusLogger listenerLevel is
-set to TRACE, resulting in verbose status messages displayed on the
-console.
-
-If no listeners are registered, the listenersLevel is not used, and the
-StatusLogger output level is determined by
-`StatusLogger.getLogger().getLevel()` (see property
-`org.apache.logging.log4j.simplelog .StatusLogger.level`).
-
-|[[statusEntries]]log4j2.statusEntries +
-([[log4j2.status.entries]]log4j2.status.entries)
-|LOG4J_STATUS_ENTRIES
-|200
-|Number of StatusLogger events that are kept in a buffer and can be
-retrieved with `StatusLogger.getStatusData()`.
-
-|[[statusLoggerDateformat]]log4j2.statusLoggerDateformat +
-([[log4j2.StatusLogger.DateFormat]]log4j2.StatusLogger.DateFormat)
-|LOG4J_STATUS_LOGGER_DATEFORMAT
-|
-|Date-time format string to use as
-the format for timestamps in the status logger output. See
-`java.text.SimpleDateFormat` for supported formats.
-
-|[[asyncLoggerExceptionHandler]]log4j2.asyncLoggerExceptionHandler +
-([[AsyncLogger.ExceptionHandler]]AsyncLogger.ExceptionHandler)
-|LOG4J_ASYNC_LOGGER_EXCEPTION_HANDLER
-|default handler
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[asyncLoggerRingBufferSize]]log4j2.asyncLoggerRingBufferSize +
-([[AsyncLogger.RingBufferSize]]AsyncLogger.RingBufferSize)
-|LOG4J_ASYNC_LOGGER_RING_BUFFER_SIZE
-|256 * 1024 or 4 * 1024 in garbage-free mode
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[asyncLoggerWaitStrategy]]log4j2.asyncLoggerWaitStrategy +
-([[AsyncLogger.WaitStrategy]]AsyncLogger.WaitStrategy)
-|LOG4J_ASYNC_LOGGER_WAIT_STRATEGY
-|Timeout
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[asyncLoggerTimeout]]log4j2.asyncLoggerTimeout +
-([[AsyncLogger.Timeout]]AsyncLogger.Timeout)
-|LOG4J_ASYNC_LOGGER_TIMEOUT
-|10
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[asyncLoggerSleepTimeNs]]log4j2.asyncLoggerSleepTimeNs +
-([[AsyncLogger.SleepTimeNs]]AsyncLogger.SleepTimeNs)
-|LOG4J_ASYNC_LOGGER_SLEEP_TIME_NS
-|100
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[asyncLoggerRetries]]log4j2.asyncLoggerRetries +
-([[AsyncLogger.Retries]]AsyncLogger.Retries)
-|LOG4J_ASYNC_LOGGER_RETRIES
-|200
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[AsyncLogger.SynchronizeEnqueueWhenQueueFull]]AsyncLogger.SynchronizeEnqueueWhenQueueFull
-|ASYNC_LOGGER_SYNCHRONIZE_ENQUEUE_WHEN_QUEUE_FULL
-|true
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[asyncLoggerThreadNameStrategy]]log4j2.asyncLoggerThreadNameStrategy +
-([[AsyncLogger.ThreadNameStrategy]]AsyncLogger.ThreadNameStrategy)
-|LOG4J_ASYNC_LOGGER_THREAD_NAME_STRATEGY
-|CACHED
-|See
-link:async.html#SysPropsAllAsync[Async Logger System Properties] for
-details.
-
-|[[asyncLoggerConfigExceptionHandler]]log4j2.asyncLoggerConfigExceptionHandler
+
-([[AsyncLoggerConfig.ExceptionHandler]]AsyncLoggerConfig.ExceptionHandler)
-|LOG4J_ASYNC_LOGGER_CONFIG_EXCEPTION_HANDLER
-|default handler
-|See
-link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
-System Properties] for details.
-
-|[[asyncLoggerConfigRingBufferSize]]log4j2.asyncLoggerConfigRingBufferSize +
-([[AsyncLoggerConfig.RingBufferSize]]AsyncLoggerConfig.RingBufferSize)
-|LOG4J_ASYNC_LOGGER_CONFIG_RING_BUFFER_SIZE
-|256 * 1024 or 4 * 1024 in garbage-free mode
-|See
-link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
-System Properties] for details.
-
-|[[asyncLoggerConfigWaitStrategy]]log4j2.asyncLoggerConfigWaitStrategy +
-([[AsyncLoggerConfig.WaitStrategy]]AsyncLoggerConfig.WaitStrategy)
-|LOG4J_ASYNC_LOGGER_CONFIG_WAIT_STRATEGY
-|Timeout
-|See
-link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
-System Properties] for details.
-
-|[[asyncLoggerConfigTimeout]]log4j2.asyncLoggerConfigTimeout +
-([[AsyncLoggerConfig.Timeout]]AsyncLoggerConfig.Timeout)
-|LOG4J_ASYNC_LOGGER_CONFIG_TIMEOUT
-|10
-|See
-link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
-System Properties] for details.
-
-|[[asyncLoggerConfigSleepTimeNs]]log4j2.asyncLoggerConfigSleepTimeNs +
-([[AsyncLoggerConfig.SleepTimeNs]]AsyncLoggerConfig.SleepTimeNs)
-|LOG4J_ASYNC_LOGGER_CONFIG_SLEEP_TIME_NS
-|100
-|See
-link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
-System Properties] for details.
-
-|[[asyncLoggerConfigRetries]]log4j2.asyncLoggerConfigRetries +
-([[AsyncLoggerConfig.Retries]]AsyncLoggerConfig.Retries)
-|LOG4J_ASYNC_LOGGER_CONFIG_RETRIES
-|200
-|See
-link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
-System Properties] for details.
-
-
-|[[AsyncLoggerConfig.SynchronizeEnqueueWhenQueueFull]]AsyncLoggerConfig.SynchronizeEnqueueWhenQueueFull
-|ASYNC_LOGGER_CONFIG_SYNCHRONIZE_ENQUEUE_WHEN_QUEUE_FULL
-|true
-|See
-link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
-System Properties] for details.
-
-|[[julLoggerAdapter]]log4j2.julLoggerAdapter +
-([[log4j.jul.LoggerAdapter]]log4j.jul.LoggerAdapter)
-|LOG4J_JUL_LOGGER_ADAPTER
-|org.apache.logging.log4j
-.jul.ApiLoggerAdapter
-|Default LoggerAdapter to use in the JUL adapter.
-By default, if log4j-core is available, then the class
-`org.apache.logging.log4j.jul .CoreLoggerAdapter` will be used.
-Otherwise, the `ApiLoggerAdapter` will be used. Custom implementations
-must provide a public default constructor.
-
-|[[formatMsgAsync]]log4j2.formatMsgAsync +
-([[log4j.format.msg.async]]log4j.format.msg.async)
-|LOG4J_FORMAT_MSG_ASYNC
-|false
-|If `false` (the default), Log4j will
-make sure the message is formatted in the caller thread, to ensure the
-value at the time of the call to the logger is the value that is logged.
-
-|[[asyncQueueFullPolicy]]log4j2.asyncQueueFullPolicy +
-([[log4j2.AsyncQueueFullPolicy]]log4j2.AsyncQueueFullPolicy)
-|LOG4J_ASYNC_QUEUE_FULL_POLICY
-|
-|
-Used by Async Loggers and the AsyncAppender to maintain application
-throughput even when the underlying appender cannot keep up with the
-logging rate and the queue is filling up.
-
-If no value is specified (the default) events are never discarded. If
-the queue is full, the logger call blocks until the event can be added
-to the queue.
-
-Specify `Discard` to drop events whose level is equal or less than the
-threshold level (INFO by default) when the queue is full.
-
-|[[discardThreshold]]log4j2.discardThreshold +
-([[log4j2.DiscardThreshold]]log4j2.DiscardThreshold)
-|LOG4J_DISCARD_THRESHOLD
-|INFO
-|Used by the
-DiscardingAsyncQueueFullPolicy to determine which events to drop when
-the queue becomes full. By default, `INFO`, `DEBUG` and `TRACE` level
-events are discarded when the queue is full. This property only has
-effect if `Discard` is specified as the `log4j2.AsyncQueueFullPolicy`.
-
-|[[messageFactory]]log4j2.messageFactory +
-([[log4j2.messageFactory]]log4j2.messageFactory)
-|LOG4J_MESSAGE_FACTORY
-|org.apache.logging.log4j.message. ParameterizedMessageFactory or
-org.apache.logging.log4j.message. ReusableMessageFactory in garbage-free
-mode
-|Default message factory used by Loggers if no factory was
-specified.
-
-|[[flowMessageFactory]]log4j2.flowMessageFactory +
-([[log4j2.flowMessageFactory]]log4j2.flowMessageFactory)
-|LOG4J_FLOW_MESSAGE_FACTORY
-|org.apache.logging.log4j.message.
-DefaultFlowMessageFactory
-|Default flow message factory used by Loggers.
-
-|[[isWebapp]]log4j2.isWebapp +
-([[log4j2.is.webapp]]log4j2.is.webapp)
-|LOG4J_IS_WEBAPP
-|true if
-`Servlet` class on class path
-|This system property can be used to force
-Log4j 2 to behave as if it is part of a web application (when true) or
-as if it is not part of a web application (when false).
-
-|[[enableThreadlocals]]log4j2.enableThreadlocals +
-([[log4j2.enable.threadlocals]]log4j2.enable.threadlocals)
-|LOG4J_ENABLE_THREADLOCALS
-|true
-|This system property can be used to
-switch off the use of threadlocals, which will partly disable Log4j's
-garbage-free behaviour: to be fully garbage-free, Log4j stores objects
-in ThreadLocal fields to reuse them, otherwise new objects are created
-for each log event. Note that this property is not effective when Log4j
-detects it is running in a web application.
-
-|[[enableDirectEncoders]]log4j2.enableDirectEncoders +
-([[log4j2.enable.direct.encoders]]log4j2.enable.direct.encoders)
-|LOG4J_ENABLE_DIRECT_ENCODERS
-|true
-|This property can be used to force
-garbage-aware Layouts and Appenders to revert to the pre-2.6 behaviour
-where converting log events to text generates temporary objects like
-Strings and char[] arrays, and converting this text to bytes generates
-temporary byte[] arrays. By default, this property is `true` and
-garbage-aware Layouts and Appenders that convert log events to text will
-convert this text to bytes without creating temporary objects.
-
-|[[initialReusableMsgSize]]log4j2.initialReusableMsgSize +
-([[log4j.initialReusableMsgSize]]log4j.initialReusableMsgSize)
-|LOG4J_INITIAL_REUSABLE_MSG_SIZE
-|128
-|In GC-free mode, this property
-determines the initial size of the reusable StringBuilders where the
-message text is formatted and potentially passed to background threads.
-
-|[[maxReusableMsgSize]]log4j2.maxReusableMsgSize +
-([[log4j.maxReusableMsgSize]]log4j.maxReusableMsgSize)
-|LOG4J_MAX_REUSABLE_MSG_SIZE
-|518
-|In GC-free mode, this property
-determines the maximum size of the reusable StringBuilders where the
-message text is formatted and potentially passed to background threads.
-
-|[[layoutStringBuilderMaxSize]]log4j2.layoutStringBuilderMaxSize +
-([[log4j.layoutStringBuilder.maxSize]]log4j.layoutStringBuilder.maxSize)
-|LOG4J_LAYOUT_STRING_BUILDER_MAX_SIZE
-|2048
-|This property determines
-the maximum size of the thread-local reusable StringBuilders used to
-format the log event to text by Layouts that extend
-AbstractStringLayout.
-
-|[[unboxRingbufferSize]]log4j2.unboxRingbufferSize +
-([[log4j.unbox.ringbuffer.size]]log4j.unbox.ringbuffer.size)
-|LOG4J_UNBOX_RINGBUFFER_SIZE
-|32
-|
-The `org.apache.logging.log4j.util.Unbox` utility manages a small
-thread-local ring buffer of StringBuilders. Each time one of the `box()`
-methods is called, the next slot in the ring buffer is used, until the
-ring buffer is full and the first slot is reused. By default the Unbox
-ring buffer has 32 slots, so user code can have up to 32 boxed
-primitives in a single logger call.
-
-If more slots are required, set system property
-`log4j.unbox.ringbuffer.size` to the desired ring buffer size. Note that
-the specified number will be rounded up to the nearest power of 2.
-
-|[[loggerContextStacktraceOnStart]]log4j2.loggerContextStacktraceOnStart +
-([[log4j.LoggerContext.stacktrace.on.start]]log4j.LoggerContext.stacktrace.on.start)
-|LOG4J_LOGGER_CONTEXT_STACKTRACE_ON_START
-|false
-|Prints a stacktrace to
-the link:#StatusMessages[status logger] at DEBUG level when the
-LoggerContext is started. For debug purposes.
-
-|[[formatMsgNoLookups]]log4j2.formatMsgNoLookups +
-([[log4j2.formatMsgNoLookups]]log4j2.formatMsgNoLookups)
-|LOG4J_FORMAT_MSG_NO_LOOKUPS
-|true
-|Disables message
-pattern lookups globally when set to `true`. This is equivalent to
-defining all message patterns using `%m{nolookups}`.
-
-|[[trustStoreLocation]]log4j2.trustStoreLocation +
-([[log4j2.trustStoreLocation]]log4j2.trustStoreLocation)
-|LOG4J_TRUST_STORE_LOCATION
-|
-|The location of the trust store. If not provided the default trust store will
be used.
-
-|[[trustStorePassword]]log4j2.trustStorePassword +
-([[log4j2.trustStorePassword]]log4j2.trustStorePassword)
-|LOG4J_TRUST_STORE_PASSWORD
-|
-|Password needed to access the trust store.
-
-|[[trustStorePasswordFile]]log4j2.trustStorePasswordFile +
-([[log4j2.trustStorePasswordFile]]log4j2.trustStorePasswordFile)
-|LOG4J_TRUST_STORE_PASSWORD_FILE
-|
-|The location of a file that contains the password for the trust store.
-
-|[[trustStorePasswordEnvironmentVariable]]log4j2.trustStorePasswordEnvironmentVariable
+
-([[log4j2.trustStorePasswordEnvironmentVariable]]log4j2.trustStorePasswordEnvironmentVariable)
-|LOG4J_TRUST_STORE_PASSWORD_ENVIRONMENT_VARIABLE
-|
-|The name of the environment variable that contains the trust store password.
-
-|[[trustStoreType]]log4j2.trustStoreType +
-([[log4j2.trustStoreType]]log4j2.trustStoreType)
-|LOG4J_TRUST_STORE_TYPE
-|
-|The type of key store used for the trust store.
-
-|[[trustStoreKeyManagerFactoryAlgorithm]]log4j2.trustStoreKeyManagerFactoryAlgorithm
+
-([[log4j2.trustStoreKeyManagerFactoryAlgorithm]]log4j2.trustStoreKeyStoreFactoryAlgorithm)
-|LOG4J_TRUST_STORE_KEY_MANAGER_FACTORY_ALGORITHM
-|
-|Java cryptographic algorithm.
-
-|[[keyStoreLocation]]log4j2.keyStoreLocation +
-([[log4j2.trustStoreLocation]]log4j2.trustStoreLocation)
-|LOG4J_KEY_STORE_LOCATION
-|
-|The location of the key store. If not provided the default key store will be
used.
-
-|[[keyStorePassword]]log4j2.keyStorePassword +
-([[log4j2.keyStorePassword]]log4j2.keyStorePassword)
-|LOG4J_KEY_STORE_PASSWORD
-|
-|Password needed to access the trust store.
-
-|[[keyStorePasswordFile]]log4j2.keyStorePasswordFile +
-([[log4j2.keyStorePasswordFile]]log4j2.keyStorePasswordFile)
-|LOG4J_KEY_STORE_PASSWORD_FILE
-|
-|The location of a file that contains the password for the key store.
-
-|[[keyStorePasswordEnvironmentVariable]]log4j2.keyStorePasswordEnvironmentVariable
+
-([[log4j2.keyStorePasswordEnvironmentVariable]]log4j2.keyStorePasswordEnvironmentVariable)
-|LOG4J_KEY_STORE_PASSWORD_ENVIRONMENT_VARIABLE
-|
-|The name of the environment variable that contains the key store password.
-
-|[[keyStoreType]]log4j2.keyStoreType +
-([[log4j2.keyStoreType]]log4j2.keyStoreType)
-|LOG4J_KEY_STORE_TYPE
-|
-|The type of key store used for the trust store.
-
-|[[keyStoreKeyManagerFactoryAlgorithm]]log4j2.keyStoreKeyManagerFactoryAlgorithm
+
-([[log4j2.keyStoreKeyManagerFactoryAlgorithm]]log4j2.keyStoreKeyStoreFactoryAlgorithm)
-|LOG4J_KEY_STORE_KEY_MANAGER_FACTORY_ALGORITHM
-|
-|Java cryptographic algorithm.
-
-
-|[[sslVerifyHostName]]log4j2.sslVerifyHostName +
-([[log4j2.sslVerifyHostName]]log4j2.sslVerifyHostName)
-|LOG4J_SSL_VERIFY_HOSTNAME
-|false
-|true or false if the host name should be verified
-
-|[[log4j2.Script.enableLanguages]]log4j2.Script.enableLanguages
-|LOG4J_SCRIPT_ENABLE_LANGUAGES
-|
-| The list of script languages that are allowed to execute. The names
specified must have a ScriptEngine installed
-that advertises the same language(s) in order for scripting to be enabled. If
no languages are specified, which is
-the default, the ScriptManager will not be installed.
-
-|===
diff --git a/src/site/asciidoc/manual/systemproperties.adoc
b/src/site/asciidoc/manual/systemproperties.adoc
new file mode 100644
index 0000000000..76592abdaf
--- /dev/null
+++ b/src/site/asciidoc/manual/systemproperties.adoc
@@ -0,0 +1,926 @@
+////
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+////
+[#SystemProperties]
+== System Properties
+
+The Log4j documentation references a number of System Properties that
+can be used to control various aspects of Log4j 2 behavior. How properties
+are handled has undergone significant changes in Log4j 3.x so properties
+defined for applications using Log4j 2.x may need to be modified to work
+with Log4j 3.x.
+
+=== Property Name Aliases
+
+Older versions of Log4j used a different format for property names. Many of
these names are still supported via
+the use of aliases. Log4j locates all files named
`META-INF/log4j2-propertyMapping.json` in which the old property
+names are mapped to their new counterparts. Applications may make use of this
by creating a file with the same path
+in a jar or classes folder that is on the class path. Note that these files
are read when Log4j initializes and are
+used to remap settings located in a Properties object managed by a
PropertySource, such as the System Properties or
+environment variables.
+
+=== Application Scoped Properties and Property Names
+
+Log4j is designed to allow multiple applications to reside in the same JVM
+and allow each to have their own set of Loggers and logging configuration,
+so it is somewhat logical that the applications may want to take advantage
+of Log4j functionality in different ways. Log4j achieves this through the
+use of the LoggerContext. A LoggerContext is the anchor point for the
configuration
+and all the Loggers in the application. However, how an application is
assigned its
+own LoggerContext depends greatly on the environment it is running in.
+
+In a typical web container, such as Tomcat or Jetty, the application server
runs
+in its own ClassLoader and then creates a separate child ClassLoader for each
application.
+In this environment, Log4j's default ContextSelector,
ClassLoaderContextSelector, works
+well by associating the LoggerContext with the current ClassLoader. However,
+JEE environments typically will need to use the JndiContextSelector to locate
the
+LoggerContext by the JNDI name associated with the application.
+
+So how does this relate to application scoped properties? The application will
need to
+provide a file containing the application specific properties, locate them as
+system properties or environment variables, or in Log4j's system scoped
properties files.
+This is achieved using the following rules:
+
+1. In general, Log4j properties are named using the scheme
``log4j2.{contextName}.{componentName}.{key}``.
+A contextName of ``\*`` indicates the property is system wide. For example,
the Log4j configuration file
+could be identified as ``log4j2.*.Configuration.file`` as the system wide
value while
+``log4j2.PaymentUI.Configuration.file`` would only apply to the application
with the context name
+of PaymentUI. Note that property names are case sensitive.
+2. Applications that use the ClassLoaderContextSelector will typically have
unpredictable names and so
+cannot be configured as system properties or in Log4j's
``log4j2.components.properties`` or
+``log4j2.components.json`` files. Instead, they should be placed into a file
named
+``META-INF/log4j2.context.properties`` or ``META-INF/log4j2.context.json`` in
the classpath
+of the ClassLoader for the application. In this case the properties should be
specified only as
+``{componentName}.{key}``, leaving off the leading "log4j2" and contextName
since these properties
+only apply to the context in which they are located.
+3. While applications that use names to identify the LoggerContext can also
use the ``META-INF/log4j2.context``
+files, generally this is not very useful since they may share ClassLoaders.
Instead, they can
+use files named ``META-INF/log4j2.{contextName}.properties`` or
``META-INF/log4j2.{contextName}.json``.
+Like the properties specified in item 2 above, these properties must also
specify their properties as
+``{componentName}.{key}`` leaving off the leading "log4j2" and contextName.
+
+=== Custom Property Sources
+
+Properties are located using PropertySources. This system is extensible
+and is enabled through the
+link:../log4j-api/apidocs/org/apache/logging/log4j/util/PropertySource.html[`PropertySource`]
+interface. Additional property source classes can be added through the
+standard `ServiceLoader` mechanism in Java SE.
+
+
+Properties can be overridden by sources with a lower number priority
+(e.g.., -100 comes before 100). The following sources are all available
+by default:
+
+.PropertySource priorities and descriptions
+[cols="2,1,5"]
+|===
+|Source |Priority |Description
+
+|Spring Boot Properties
+|-100
+|This property source is enabled only if the Java application uses Spring Boot
and the
+`log4j-spring` module is present. It resolves properties using a Spring
+link:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/Environment.html[Environment].
+
+|System Properties
+|0
+|All properties can be set using normal system
+property patterns. These have the lowest numerical priority among commonly
available property sources
+and can override included `log4j2.component.properties` files or environment
variables. If a `log4j2.system.properties` file is available on the classpath
its contents are
+sourced into Java system properties at Log4j startup.
+
+|Environment Variables
+|100
+|Environment variables are all prefixed
+with `LOG4J_`, are in all caps, and words are all separated by
+underscores. Only this naming scheme is support for environment
+variables as there were no old naming schemes to maintain compatibility
+with.
+
+|`log4j2.context.json` or `log4j2.{contextName}.json`
+|110
+|Properties in these files only apply to the specific LoggerContext to which
they are bound, either by name or ClassLoader.
+
+|`log4j2.context.properties' or `log4j2.{contextName}.properties`
+|120
+|Properties in these files only apply to the specific LoggerContext to which
they are bound, either by name or ClassLoader.
+
+|`log4j2.component.properties` file
+|200
+|Including this file on the classpath can be used as an alternative to
providing properties as system
+properties. This is the property source with highest numerical priority and
can be used to provide
+default values that can be overridden by the system administrator.
+|===
+
+The table below lists these properties that are included as part of the Log4j
API along with their
+default value and a description of what they control. The component identifies
tha category the property
+fits into, the alias includes values from Log4j 2.x that are still allowed,
the Scope identifies whether
+the setting may be applied system wide and/or to a LoggerContext.
+
+.Log4j 2 API configuration properties
+[cols="1,1,3,1,2,3"]
+|===
+|Component Name |Property Key |Alias |Scope |Default Value |Description
+
+|GC
+|initialReusableMsgSize
+|log4j2.initialReusableMsgSize, LOG4J_INITIAL_REUSABLE_MSG_SIZE
+|System/Application
+|128
+|In GC-free mode, this property determines the initial size of the reusable
StringBuilders where the
+message text is formatted and potentially passed to background threads.
+
+|GC
+|maxReusableMsgSize
+|log4j2.maxReusableMsgSize, LOG4J_MAX_REUSABLE_MSG_SIZE
+|System/Application
+|518
+|In GC-free mode, this property determines the maximum size of the reusable
StringBuilders where the
+message text is formatted and potentially passed to background threads.
+
+|Loader
+|forceTCLOnly
+|log4j2.forceTCLOnly, LOG4J_FORCE_TCL_ONLY
+|System
+|false
+|If `true`, classes and configuration are only loaded with the default context
class loader.
+Otherwise, log4j also uses the log4j classloader, parent classloaders and the
system classloader.
+
+|Loader
+|ignoreTCL
+|log4j2.ignoreTCL, LOG4J_IGNORE_TCL
+|System
+|false
+|If `true`, classes are only loaded with the default class loader. Otherwise,
an attempt is made to load
+classes with the current thread's context class loader before falling back to
the default class loader.
+
+|LoggerContext
+|factory
+|log4j2.loggerContextFactory, LOG4J_LOGGER_CONTEXT_FACTORY
+|System
+|org.apache.logging.log4j.simple.SimpleLoggerContextFactory
+|Factory class used by LogManager tobootstrap the logging implementation. The
core jar provides
+`org.apache.logging.log4j.core.impl.Log4jContextFactory`.
+
+|Message
+|factory
+|log4j2.messageFactory, LOG4J_MESSAGE_FACTORY
+|System/Application
+|org.apache.logging.log4j.message. ParameterizedMessageFactory or
+org.apache.logging.log4j.message. ReusableMessageFactory in garbage-free
+mode
+|Default message factory used by Loggers if no factory was specified.
+
+|Message
+|flowMessageFactory
+|log4j2.flowMessageFactory, LOG4J_FLOW_MESSAGE_FACTORY
+|System/Application
+|org.apache.logging.log4j.message.DefaultFlowMessageFactory
+|Default flow message factory used by Loggers.
+
+|SimpleLogger
+|showContextMap
+|log4j2.simplelogShowContextMap, LOG4J_SIMPLELOG_SHOW_CONTEXT_MAP
+|System
+|false
+|If `true`, the full ThreadContext map is included in each SimpleLogger log
message.
+
+|SimpleLogger
+|showLogName
+|log4j2.simplelogShowlogname, LOG4J_SIMPLELOG_SHOWLOGNAME
+|System
+|false
+|If `true` the logger name is included in each SimpleLogger log message.
+
+|SimpleLogger
+|showShortLogName
+|log4j2.simplelogShowShortLogname, LOG4J_SIMPLELOG_SHOW_SHORT_LOGNAME
+|System
+|true
+|If `true`, only the last component of a logger name is included in
SimpleLogger log messages. (E.g.,
+if the logger name is "mycompany.myproject.mycomponent", only "mycomponent" is
logged.
+
+|SimpleLogger
+|showDateTime
+|log4j2.simplelogShowdatetime, LOG4J_SIMPLELOG_SHOWDATETIME
+|System
+|false
+|If `true`, SimpleLogger log messages contain timestamp information.
+
+|SimpleLogger
+|dateTimeFormat
+|log4j2.simplelogDateTimeFormat, LOG4J_SIMPLELOG_DATE_TIME_FORMAT
+|System
+|"yyyy/MM/dd HH:mm:ss:SSS zzz"
+|Date-time format to use. Ignored if `SimpleLogger.showDateTime` is `false`.
+
+|SimpleLogger
+|logFile
+|log4j2.simplelogLogFile, LOG4J_SIMPLELOG_LOG_FILE
+|System
+|system.err
+|"system.err" (case-insensitive) logs to System.err, "system.out"
(case-insensitive)
+logs to System.out, any other value is interpreted as a file name to save
SimpleLogger messages to.
+
+|SimpleLogger
+|level
+|log4j2.simplelogLevel, LOG4J_SIMPLELOG_LEVEL
+|System
+|ERROR
+|Default level for new SimpleLogger instances.
+
+|SimpleLogger
+|statusLoggerLevel
+|log4j2.simplelogStatusLoggerLevel, LOG4J_SIMPLELOG_STATUS_LOGGER_LEVEL
+|System
+|ERROR
+|This property is used to control the initial StatusLogger level, and can be
overridden in code by calling
+`StatusLogger.getLogger() .setLevel(someLevel)`. Note that the
+StatusLogger level is only used to determine the status log output level
+until a listener is registered. In practice, a listener is registered
+when a configuration is found, and from that point onwards, status
+messages are only sent to the listeners (depending on their
+statusLevel).
+
+|StatusLogger
+|debug
+|log4j2.debug, LOG4J_DEBUG
+|System/Application
+|false
+|Log4j2 will print all
+internal logging to the console if system property `log4j2.debug` is either
+defined empty or its value equals to `true` (ignoring case).
+
+|StatusLogger
+|entries
+|log4j2.statusEntries, LOG4J_STATUS_ENTRIES
+|System
+|200
+|Number of StatusLogger events that are kept in a buffer and can be retrieved
with `StatusLogger.getStatusData()`.
+
+|StatusLogger
+|dateFormat
+|log4j2.statusLoggerDateformat, LOG4J_STATUS_LOGGER_DATEFORMAT
+|System
+|
+|Date-time format string to use as the format for timestamps in the status
logger output. See
+`java.text.SimpleDateFormat` for supported formats.
+
+|StatusLogger
+|defaultLevel
+|log4j2.defaultStatusLevel, LOG4J_DEFAULT_STATUS_LEVEL
+|System
+|ERROR
+|The StatusLogger logs events that occur in the logging system to the console.
During configuration,
+AbstractConfiguration registers a StatusConsoleListener with the StatusLogger
that may redirect status log
+events from the default console output to a file. The listener also
+supports fine-grained filtering. This system property specifies the
+default status log level for the listener to use if the configuration
+does not specify a status level.
+
+Note: this property is used by the log4j-core implementation only after a
configuration file has been found.
+
+|StatusLogger
+|level
+|log4j2.statusLoggerLevel, LOG4J_STATUS_LOGGER_LEVEL
+|System
+|WARN
+|The initial "listenersLevel" of the StatusLogger. If StatusLogger listeners
are added, the
+"listenerLevel" is changed to that of the most verbose listener. If any
listeners are
+registered, the listenerLevel is used to quickly determine if an interested
listener exists.
+
+By default, StatusLogger listeners are added when a configuration is
+found and by the JMX StatusLoggerAdmin MBean. For example, if a
+configuration contains `<Configuration status="trace">`, a listener with
+statusLevel TRACE is registered and the StatusLogger listenerLevel is
+set to TRACE, resulting in verbose status messages displayed on the
+console.
+
+If no listeners are registered, the listenersLevel is not used, and the
+StatusLogger output level is determined by
+`StatusLogger.getLogger().getLevel()` (see property
+`org.apache.logging.log4j.simplelog .StatusLogger.level`).
+
+|ThreadContext
+|enable
+|
+|System
+|true
+|If `false`,the ThreadContext stack and map are disabled. (May be ignored if a
+custom ThreadContext map is specified.) NOTE - this setting changed from
`log4j2.disableThreadContext`
+in 2.x so cannot be mapped to 3.0 since it has the opposite meaning.
+
+|ThreadContext
+|enableStack
+|
+|System
+|false
+|If `false`, the ThreadContext stack is disabled. NOTE - this setting changed
from
+`log4j2.disableThreadContextStack` in 2.x so cannot be mapped to 3.0 since it
has the opposite meaning.
+
+|ThreadContext
+|enableMap
+|
+|System
+|false
+|If `false`, the ThreadContext map is disabled. (May be ignored if a custom
ThreadContext map is specified.)
+NOTE - this setting changed from `log4j2.disableThreadContextMap` in 2.x so
cannot be mapped to 3.0
+since it has the opposite meaning.
+
+|ThreadContext
+|garbageFree
+|log4j2.garbagefreeThreadContextMap, LOG4J_GARBAGEFREE_THREAD_CONTEXT_MAP
+|System
+|false
+|Specify "true" to make the ThreadContext map garbage-free.
+
+|ThreadContext
+|mapClass
+|log4j2.threadContextMap, LOG4J_THREAD_CONTEXT_MAP
+|System
+|
+|Fully specified
+class name of a custom `ThreadContextMap` implementation class.
+
+|ThreadContext
+|mapInheritable
+|log4j2.isThreadContextMapInheritable, LOG4J_IS_THREAD_CONTEXT_MAP_INHERITABLE
+|System
+|false
+|If `true` use a `InheritableThreadLocal` to implement the ThreadContext map.
Otherwise, use a plain `ThreadLocal`.
+(May be ignored if a custom ThreadContext map is specified.)
+
+|ThreadLocals
+|enable
+|log4j2.enableThreadlocals, LOG4J_ENABLE_THREADLOCALS
+|System
+|true
+|This system property can be used to switch off the use of threadlocals, which
will partly disable Log4j's
+garbage-free behaviour: to be fully garbage-free, Log4j stores objects in
ThreadLocal fields to reuse them,
+otherwise new objects are created for each log event. Note that this property
is not effective when Log4j
+detects it is running in a web application.
+
+|Unbox
+|ringBufferSize
+|log4j2.unboxRingbufferSize, LOG4J_UNBOX_RINGBUFFER_SIZE
+|System
+|32
+|The `org.apache.logging.log4j.util.Unbox` utility manages a small
+thread-local ring buffer of StringBuilders. Each time one of the `box()`
+methods is called, the next slot in the ring buffer is used, until the
+ring buffer is full and the first slot is reused. By default the Unbox
+ring buffer has 32 slots, so user code can have up to 32 boxed
+primitives in a single logger call.
+
+If more slots are required, set system property
+`Unbox.ringBufferSize` to the desired ring buffer size. Note that
+the specified number will be rounded up to the nearest power of 2.
+
+
+|Web
+|isWebApp
+|log4j2.isWebapp, LOG4J_IS_WEBAPP
+|System
+|true if `Servlet` class on class path
+|This system property can be used to force Log4j 2 to behave as if it is part
of a web application (when true) or
+as if it is not part of a web application (when false).
+
+|===
+
+The table below lists these properties that are included as part of the Log4j
Implementation along with their
+default value and a description of what they control. The component identifies
tha category the property
+fits into, the alias includes values from Log4j 2.x that are still allowed,
the Scope identifies whether
+the setting may be applied system wide and/or to a LoggerContext.
+
+.Log4j 2 Core configuration properties
+[cols="1,1,3,1,2,3"]
+|===
+|Component Name |Property Key |Alias |Scope |Default Value |Description
+
+
+|AsyncLogger
+|discardThreshold
+|log4j2.discardThreshold, LOG4J_DISCARD_THRESHOLD
+|System
+|INFO
+|Used by the DiscardingAsyncQueueFullPolicy to determine which events to drop
when the queue becomes full.
+By default, `INFO`, `DEBUG` and `TRACE` level events are discarded when the
queue is full. This property only has
+effect if `Discard` is specified as the `AsyncLogger.QueueFullPolicy`.
+
+|AsyncLogger
+|exceptionHandler
+|log4j2.asyncLoggerExceptionHandler, LOG4J_ASYNC_LOGGER_EXCEPTION_HANDLER
+|System
+|default handler
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLogger
+|formatMsg
+|log4j2.formatMsgAsync, LOG4J_FORMAT_MSG_ASYNC
+|System
+|false
+|If `false` (the default), Log4j will make sure the message is formatted in
the caller thread, to ensure the
+value at the time of the call to the logger is the value that is logged.
+
+|AsyncLogger
+|queueFullPolicy
+|log4j2.asyncQueueFullPolicy, LOG4J_ASYNC_QUEUE_FULL_POLICY
+|System
+|
+|Used by Async Loggers and the AsyncAppender to maintain application
throughput even when the underlying
+appender cannot keep up with the logging rate and the queue is filling up.
+
+If no value is specified (the default) events are never discarded. If the
queue is full, the logger call blocks
+until the event can be added to the queue.
+
+Specify `Discard` to drop events whose level is equal or less than the
threshold level (INFO by default) when
+the queue is full.
+
+|AsyncLogger
+|retries
+|log4j2.asyncLoggerRetries, LOG4J_ASYNC_LOGGER_RETRIES
+|System
+|200
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLogger
+|ringBufferSize
+|log4j2.asyncLoggerRingBufferSize, LOG4J_ASYNC_LOGGER_RING_BUFFER_SIZE
+|System
+|256 * 1024 or 4 * 1024 in garbage-free mode
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLogger
+|sleepTimeNS
+|log4j2.asyncLoggerSleepTimeNs, LOG4J_ASYNC_LOGGER_SLEEP_TIME_NS
+|System
+|100
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLogger
+|timeout
+|log4j2.asyncLoggerTimeout, LOG4J_ASYNC_LOGGER_TIMEOUT
+|System
+|10
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLogger
+|waitStrategy
+|log4j2.asyncLoggerWaitStrategy, LOG4J_ASYNC_LOGGER_WAIT_STRATEGY
+|System
+|Timeout
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLogger
+|syncronizeEnqueueWhenQueueFull
+|AsyncLogger.SynchronizeEnqueueWhenQueueFull,
ASYNC_LOGGER_SYNCHRONIZE_ENQUEUE_WHEN_QUEUE_FULL
+|System
+|true
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLogger
+|threadNameStrategy
+|log4j2.asyncLoggerThreadNameStrategy, LOG4J_ASYNC_LOGGER_THREAD_NAME_STRATEGY
+|System
+|CACHED
+|See link:async.html#SysPropsAllAsync[Async Logger System Properties] for
details.
+
+|AsyncLoggerConfig
+|exceptionHandler
+|log4j2.asyncLoggerConfigExceptionHandler,
LOG4J_ASYNC_LOGGER_CONFIG_EXCEPTION_HANDLER
+|System
+|default handler
+|See link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
System Properties] for details.
+
+|AsyncLoggerConfig
+|ringBufferSize
+|log4j2.asyncLoggerConfigRingBufferSize,
LOG4J_ASYNC_LOGGER_CONFIG_RING_BUFFER_SIZE
+|System
+|256 * 1024 or 4 * 1024 in garbage-free mode
+|See link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
System Properties] for details.
+
+|AsyncLoggerConfig
+|waitStrategy
+|log4j2.asyncLoggerConfigWaitStrategy, LOG4J_ASYNC_LOGGER_CONFIG_WAIT_STRATEGY
+|System
+|Timeout
+|See link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
System Properties] for details.
+
+|AsyncLoggerConfig
+|timeout
+|log4j2.asyncLoggerConfigTimeout, LOG4J_ASYNC_LOGGER_CONFIG_TIMEOUT
+|System
+|10
+|See link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
System Properties] for details.
+
+|AsyncLoggerConfig
+|sleepTimeNS
+|log4j2.asyncLoggerConfigSleepTimeNs, LOG4J_ASYNC_LOGGER_CONFIG_SLEEP_TIME_NS
+|System
+|100
+|See link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
System Properties] for details.
+
+|AsyncLoggerConfig
+|retries
+|log4j2.asyncLoggerConfigRetries, LOG4J_ASYNC_LOGGER_CONFIG_RETRIES
+|System
+|200
+|See link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
System Properties] for details.
+
+|AsyncLoggerConfig
+|synchronizeEnqueueWhenQueueFull
+|AsyncLoggerConfig.SynchronizeEnqueueWhenQueueFull,
ASYNC_LOGGER_CONFIG_SYNCHRONIZE_ENQUEUE_WHEN_QUEUE_FULL
+|System
+|true
+|See link:async.html#SysPropsMixedSync-Async[Mixed Async/Synchronous Logger
System Properties] for details.
+
+|Configuration
+|allowedProtocols
+|log4j2.Configuration.allowedProtocols, LOG4J_CONFIGURATION_ALLOWED_PROTOCOLS
+|System/Application
+|
+|A comma separated list of the protocols that may be used to load a
configuration file. The default is https.
+To completely prevent accessing the configuration via a URL specify a value of
"_none".
+
+|Configuration
+|authorizationProvider
+|log4j2.Configuration.authorizationProvider,
LOG4J_CONFIGURATION_AUTHORIZATION_PROVIDER
+|System/Application
+|org.apache.logging.log4j.core.util.BasicAuthorizationProvider
+|The fully qualified class name of the AuthorizationProvider.
+
+|Configuration
+|clock
+|log4j2.clock, LOG4J_CLOCK
+|System/Application
+|SystemClock
+|Implementation of the `org.apache.logging.log4j .core.time.Clock` interface
that is
+used for timestamping the log events. +
+By default, `System.currentTimeMillis` is called on every log event. +
+You can also specify a fully qualified class name of a custom class that
implements the `Clock` interface.
+
+|Configuration
+|factory
+|log4j2.configurationFactory, LOG4J_CONFIGURATION_FACTORY
+|System/Application
+|
+|Fully specified class name of a classextending
+`org.apache.logging.log4j.core .config.ConfigurationFactory`.
+If specified, an instance of this class is added to the list ofconfiguration
factories.
+
+|Configuration
+|File
+|log4j2.configurationFile, LOG4J_CONFIGURATION_FILE
+|System
+|
+|Path to an Log4j 2 configuration file. May
+also contain a comma separated list of configuration file names. May contain a
URL.
+When specified as a URL the "override" query parameter may be used to specify
additional
+configuration file locations.
+
+|Configuration
+|jansiEnabled
+|NBSP
+|System/Application
+|false
+|If `false`, the ConsoleAppender will not try to use the Jansi output stream
on Windows.
+NOTE - this setting was named `log4j2.skipJansi in 2.x so cannot be mapped to
3.0 since it has the opposite meaning.
+
+|Configuration
+|mergeStrategy
+|log4j2.mergeStrategy, LOG4J_MERGE_STRATEGY
+|System/Application
+|
+|The name of the class that implements the MergeStrategy interface. If not
+specified `DefaultMergeStrategy` will be used when creating a
CompositeConfiguration.
+
+|Configuration
+|password
+|log4j2.Configuration.password, LOG4J_CONFIGURATION_PASSWORD
+|System/Application
+|
+|The password required to access the remote logging configuration file.
+
+|Configuration
+|passwordDecryptor
+|log4j2.Configuration.passwordDecryptor, LOG4J_CONFIGURATION_DECRYPTOR
+|System/Application
+|
+|If the password is encrypted this class will be used to decrypt it.
+
+|Configuration
+|userName
+|log4j2.Configuration.username, LOG4J_CONFIGURATION_USERNAME
+|System/Application
+|
+|The user name required to access the remote logging configuration file.
+
+|Configuration
+|usePreciseClock
+|log4j2.usePreciseClock, LOG4J_USE_PRECISE_CLOCK
+|System/Application
+|false
+|When false the clock resolution will be in milliseconds. When true it will
use the smallest granularity supported by
+the JVM. The precise clock is not garbage free. This setting only applies when
Log4j's default SystemClock is used.
+
+|Configuration
+|level
+|log4j2.level, LOG4J_LEVEL
+|System/Application
+|ERROR
+|Log level of the default configuration. The default configuration is used if
the ConfigurationFactory
+could not successfully create a configuration (e.g. no log4j2.xml file was
found).
+
+|GC
+|enableDirectEncoders
+|log4j2.enableDirectEncoders, LOG4J_ENABLE_DIRECT_ENCODERS
+|System/Application
+|true
+|This property can be used to force
+garbage-aware Layouts and Appenders to revert to the pre-2.6 behaviour
+where converting log events to text generates temporary objects like
+Strings and char[] arrays, and converting this text to bytes generates
+temporary byte[] arrays. By default, this property is `true` and
+garbage-aware Layouts and Appenders that convert log events to text will
+convert this text to bytes without creating temporary objects.
+
+|GC
+|layoutStringBuilderMaxSize
+|log4j2.layoutStringBuilderMaxSize, LOG4J_LAYOUT_STRING_BUILDER_MAX_SIZE
+|System/Application
+|2048
+|This property determinesthe maximum size of the thread-local reusable
StringBuilders used to
+format the log event to text by Layouts that extend AbstractStringLayout.
+
+
+|JMX
+|enabled
+|NBSP
+|System/Application
+|true
+|If `false`, Log4j configuration objects like LoggerContexts, Appenders,
Loggers, etc. will not be instrumented
+with MBeans and cannot be remotely monitored and managed. NOTE - this setting
was `log4j2.disableJmx` in 2.x
+so cannot be mapped to 3.0 since it has the opposite meaning.
+
+|JMX
+|notifyAsync
+|log4j2.jmxNotifyAsync, LOG4J_JMX_NOTIFY_ASYNC
+|System/Application
+|false for web apps, true otherwise
+|If `true`, log4j's JMX notifications are sent from a separate background
thread,
+otherwise they are sent from the caller thread. If system property
+`Web.isWebApp` is `true` or the `javax.servlet.Servlet` class is on
+the classpath, the default behaviour is to use the caller thread to send
+JMX notifications.
+
+|JNDI
+|contextSelector
+|NBSP
+|System/Application
+|false
+|When true, the JndiContextSelector is enabled if the log4j-jndi jar is
present on the classpath.
+
+|JNDI
+|enableJDBC
+|NBSP
+|System/Application
+|false
+|When true, the use of JNDI the JdbcAppender is enabled if the log4j-jndi jar
is present on the classpath.
+
+|JNDI
+|enableJMS
+|NBSP
+|System/Application
+|false
+|When true, the use of JNDI the JmsAppender is enabled if the log4j-jndi and
log4j-jms jars are present on the
+classpath.
+
+|JNDI
+|enableLookup
+|NBSP
+|System/Application
+|false
+|When true, the use of JndiLookup is enabled if the log4j-jndi jar is present
on the classpath.
+
+|LoggerContext
+|selector
+|log4j2.contextSelector, LOG4J_CONTEXT_SELECTOR
+|System
+|ClassLoaderContextSelector
+|Creates the `LoggerContext`s. An
+application can have one or more active LoggerContexts depending on the
+circumstances. See link:logsep.html[Log Separation] for more details.
+Available context selector implementation classes: +
+`org.apache.logging.log4j.core.async .AsyncLoggerContextSelector` -
+makes link:async.html[all loggers asynchronous]. +
+`org.apache.logging.log4j.core.async .BasicAsyncLoggerContextSelector` -
+makes link:async.html[all loggers asynchronous] using a single shared
+AsyncLoggerContext. +
+`org.apache.logging.log4j.core.selector .BasicContextSelector` - creates
+a single shared LoggerContext. +
+`org.apache.logging.log4j.core.selector .ClassLoaderContextSelector` -
+separate LoggerContexts for each web application. +
+`org.apache.logging.log4j.core.selector .JndiContextSelector` - use JNDI
+to locate each web application's LoggerContext. +
+`org.apache.logging.log4j.core.osgi .BundleContextSelector` - separate
+LoggerContexts for each OSGi bundle.
+
+|Logger
+|logEventFactory
+|log4j2.logEventFactory, LOG4J_LOG_EVENT_FACTORY
+|System/Application
+|org.apache.logging.log4j.core.impl .DefaultLogEventFactory
+|Factory class used by LoggerConfig to create `LogEvent` instances. (Ignored
when
+the `AsyncLoggerContextSelector` is used.)
+
+|LoggerContext
+|shutdownHookEnabled
+|log4j2.shutdownHookEnabled, LOG4J_SHUTDOWN_HOOK_ENABLED
+|System/Application
+|true
+|Overrides the global flag forwhether or not a shutdown hook should be used to
stop a
+`LoggerContext`. By default, this is enabled and can be
+disabled on a per-configuration basis. When running with the `log4j-web`
+module, this is automatically disabled.
+
+|LoggerContext
+|shutdownCallbackRegistry
+|log4j2.shutdownCallbackRegistry, LOG4J_SHUTDOWN_CALLBACK_REGISTRY
+|System/Application
+|org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
+|Fully specified class name of a class implementing
+link:../log4j-core/apidocs/org/apache/logging/log4j/core/util/ShutdownCallbackRegistry.html[ShutdownCallbackRegistry].
+If specified, an instance of this class is used instead of
`DefaultShutdownCallbackRegistry`. The specified class
+must have a default constructor.
+
+|LoggerContext
+|stackTraceOnStart
+|log4j2.loggerContextStacktraceOnStart,
LOG4J_LOGGER_CONTEXT_STACKTRACE_ON_START
+|System/Application
+|false
+|Prints a stacktrace to the link:#StatusMessages[status logger] at DEBUG level
when the
+LoggerContext is started. For debug purposes.
+
+|ThreadContext
+|contextDataInjector
+|log4j2.contextDataInjector, LOG4J_CONTEXT_DATA_INJECTOR
+|System/Application
+|
+|Fully specified class name of a custom `ContextDataInjector` implementation
class.
+
+|TransportSecurity
+|keyStoreLocation
+|log4j2.keyStoreLocation, LOG4J_KEY_STORE_LOCATION
+|System
+|
+|The location of the key store. If not provided the default key store will be
used.
+
+|TransportSecurity
+|keyStorePassword
+|log4j2.keyStorePassword, LOG4J_KEY_STORE_PASSWORD
+|System
+|
+|Password needed to access the trust store.
+
+|TransportSecurity
+|keyStorePasswordFile
+|log4j2.keyStorePasswordFile, LOG4J_KEY_STORE_PASSWORD_FILE
+|System
+|
+|The location of a file that contains the password for the key store.
+
+|TransportSecurity
+|keyStorePasswordEnvironmentVariable
+|log4j2.keyStorePasswordEnvironmentVariable,
LOG4J_KEY_STORE_PASSWORD_ENVIRONMENT_VARIABLE
+|System
+|
+|The name of the environment variable that contains the key store password.
+
+|TransportSecurity
+|keyStoreType
+|log4j2.keyStoreType, LOG4J_KEY_STORE_TYPE
+|System
+|
+|The type of key store used for the trust store.
+
+|TransportSecurity
+|keyStoreKeyManagerFactoryAlgorithm
+|log4j2.keyStoreKeyManagerFactoryAlgorithm,
LOG4J_KEY_STORE_KEY_MANAGER_FACTORY_ALGORITHM
+|System
+|
+|Java cryptographic algorithm.
+
+|TransportSecurity
+|sslVerifyHostName
+|log4j2.sslVerifyHostName, LOG4J_SSL_VERIFY_HOSTNAME
+|System/Application
+|false
+|true or false if the host name should be verified
+
+|TransportSecurity
+|trustStoreLocation
+|log4j2.trustStoreLocation, LOG4J_TRUST_STORE_LOCATION
+|System
+|
+|The location of the trust store. If not provided the default trust store will
be used.
+
+|TransportSecurity
+|trustStorePassword
+|log4j2.trustStorePassword, LOG4J_TRUST_STORE_PASSWORD
+|System
+|
+|Password needed to access the trust store.
+
+|TransportSecuirty
+|trustStorePasswordFile
+|log4j2.trustStorePasswordFile, LOG4J_TRUST_STORE_PASSWORD_FILE
+|System
+|
+|The location of a file that contains the password for the trust store.
+
+|TransportSecuirty
+|trustStorePasswordEnvironmentVariable
+|log4j2.trustStorePasswordEnvironmentVariable,
LOG4J_TRUST_STORE_PASSWORD_ENVIRONMENT_VARIABLE
+|System
+|
+|The name of the environment variable that contains the trust store password.
+
+|TransportSecurity
+|trustStoreType
+|log4j2.trustStoreType, LOG4J_TRUST_STORE_TYPE
+|System
+|
+|The type of key store used for the trust store.
+
+|TransportSecurity
+|trustStoreKeyManagerFactoryAlgorithm
+|log4j2.trustStoreKeyManagerFactoryAlgorithm,
LOG4J_TRUST_STORE_KEY_MANAGER_FACTORY_ALGORITHM
+|System
+|
+|Java cryptographic algorithm.
+
+|UUID
+|sequence
+|log4j2.uuidSequence, LOG4J_UUID_SEQUENCE
+|System
+|0
+|System property that may be used to seed the UUID generation with an integer
value.
+
+|===
+
+The table below lists the properties that are included as part of the Log4j
JUL component along with their
+default value and a description of what they control. The component identifies
tha category the property
+fits into, the alias includes values from Log4j 2.x that are still allowed,
the Scope identifies whether
+the setting may be applied system wide and/or to a LoggerContext.
+
+.Log4j 3 JUL properties
+[cols="1,1,3,1,2,3"]
+|===
+|Component Name |Property Key |Alias |Scope |Default Value |Description
+
+|JUL
+|loggerAdapter
+|log4j2.julLoggerAdapter, LOG4J_JUL_LOGGER_ADAPTER
+|System
+|org.apache.logging.log4j .jul.ApiLoggerAdapter
+|Default LoggerAdapter to use in the JUL adapter.
+By default, if log4j-core is available, then the class
`org.apache.logging.log4j.jul .CoreLoggerAdapter` will be used.
+Otherwise, the `ApiLoggerAdapter` will be used. Custom implementations
+must provide a public default constructor.
+
+|===
+
+The table below lists the properties that are included as part of the Log4j
Script component along with their
+default value and a description of what they control. The component identifies
tha category the property
+fits into, the alias includes values from Log4j 2.x that are still allowed,
the Scope identifies whether
+the setting may be applied system wide and/or to a LoggerContext.
+
+.Log4j 3 Script properties
+[cols="1,1,3,1,2,3"]
+|===
+|Component Name |Property Key |Alias |Scope |Default Value |Description
+
+|Script
+|enableLanguages
+|log4j2.Script.enableLanguages, LOG4J_SCRIPT_ENABLE_LANGUAGES
+|System/Application
+|false
+| The list of script languages that are allowed to execute. The names
specified must have a ScriptEngine installed
+that advertises the same language(s) in order for scripting to be enabled. If
no languages are specified, which is
+the default, the ScriptManager will not be installed.
+
+|===
\ No newline at end of file
diff --git a/src/site/site.xml b/src/site/site.xml
index 26b7555e02..83be154be3 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -118,7 +118,7 @@
<item name="Composite Configurations"
href="/manual/configuration.html#CompositeConfiguration"/>
<item name="Status Messages"
href="/manual/configuration.html#StatusMessages"/>
<item name="Unit Testing in Maven"
href="/manual/configuration.html#UnitTestingInMaven"/>
- <item name="System Properties"
href="/manual/configuration.html#SystemProperties"/>
+ <item name="System Properties" href="/manual/systemProperties.html"/>
</item>
<item name="Usage" href="/manual/usage.html" collapse="true">