Class JavaLookup
- java.lang.Object
-
- org.apache.logging.log4j.core.lookup.AbstractLookup
-
- org.apache.logging.log4j.core.lookup.JavaLookup
-
- All Implemented Interfaces:
StrLookup
@Plugin(name="java", category="Lookup") public class JavaLookup extends AbstractLookup
Looks up keys related to Java: Java version, JRE version, VM version, and so on.
-
-
Field Summary
Fields Modifier and Type Field Description private SystemPropertiesLookup
spLookup
-
Constructor Summary
Constructors Constructor Description JavaLookup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getHardware()
Accessible through the Lookup keyhw
.java.lang.String
getLocale()
Accessible through the Lookup keylocale
.java.lang.String
getOperatingSystem()
Accessible through the Lookup keyos
.java.lang.String
getRuntime()
Accessible through the Lookup keyruntime
.private java.lang.String
getSystemProperty(java.lang.String name)
private java.lang.String
getSystemProperty(java.lang.String prefix, java.lang.String name)
java.lang.String
getVirtualMachine()
Accessible through the Lookup keyvm
.java.lang.String
lookup(LogEvent event, java.lang.String key)
Looks up the value of the environment variable.-
Methods inherited from class org.apache.logging.log4j.core.lookup.AbstractLookup
evaluate, lookup
-
-
-
-
Field Detail
-
spLookup
private final SystemPropertiesLookup spLookup
-
-
Method Detail
-
getHardware
public java.lang.String getHardware()
Accessible through the Lookup keyhw
.- Returns:
- hardware processor information.
-
getLocale
public java.lang.String getLocale()
Accessible through the Lookup keylocale
.- Returns:
- system locale and file encoding information.
-
getOperatingSystem
public java.lang.String getOperatingSystem()
Accessible through the Lookup keyos
.- Returns:
- operating system information.
-
getRuntime
public java.lang.String getRuntime()
Accessible through the Lookup keyruntime
.- Returns:
- Java Runtime Environment information.
-
getSystemProperty
private java.lang.String getSystemProperty(java.lang.String name)
-
getSystemProperty
private java.lang.String getSystemProperty(java.lang.String prefix, java.lang.String name)
-
getVirtualMachine
public java.lang.String getVirtualMachine()
Accessible through the Lookup keyvm
.- Returns:
- Java Virtual Machine information.
-
lookup
public java.lang.String lookup(LogEvent event, java.lang.String key)
Looks up the value of the environment variable.- Parameters:
event
- The current LogEvent (is ignored by this StrLookup).key
- the key to be looked up, may be null- Returns:
- The value of the environment variable.
-
-