public final class Constants
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
ENABLE_THREADLOCALS
Kill switch for object pooling in ThreadLocals that enables much of the LOG4J2-1270 no-GC behaviour.
|
static boolean |
IS_WEB_APP
true if we think we are running in a web container, based on the boolean value of system property
"log4j2.is.webapp", or (if this system property is not set) whether the javax.servlet.Servlet class
is present in the classpath. |
static int |
JAVA_MAJOR_VERSION |
Modifier | Constructor and Description |
---|---|
private |
Constants()
Prevent class instantiation.
|
Modifier and Type | Method and Description |
---|---|
private static int |
getMajorVersion() |
private static boolean |
isClassAvailable(java.lang.String className)
Determines if a named Class can be loaded or not.
|
public static final boolean IS_WEB_APP
true
if we think we are running in a web container, based on the boolean value of system property
"log4j2.is.webapp", or (if this system property is not set) whether the javax.servlet.Servlet
class
is present in the classpath.public static final boolean ENABLE_THREADLOCALS
True
for non-web apps
, disable by setting system property
"log4j2.enable.threadlocals" to "false".
public static final int JAVA_MAJOR_VERSION
private static boolean isClassAvailable(java.lang.String className)
className
- The class name.true
if the class could be found or false
otherwise.private static int getMajorVersion()