org.apache.logging.log4j.core.lookup
Class JavaLookup

java.lang.Object
  extended by org.apache.logging.log4j.core.lookup.AbstractLookup
      extended by 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 inherited from interface org.apache.logging.log4j.core.lookup.StrLookup
CATEGORY
 
Constructor Summary
JavaLookup()
           
 
Method Summary
 String getHardware()
          Accessible through the Lookup key hw.
 String getLocale()
          Accessible through the Lookup key locale.
 String getOperatingSystem()
          Accessible through the Lookup key os.
 String getRuntime()
          Accessible through the Lookup key runtime.
 String getVirtualMachine()
          Accessible through the Lookup key vm.
 String lookup(LogEvent event, String key)
          Looks up the value of the environment variable.
 
Methods inherited from class org.apache.logging.log4j.core.lookup.AbstractLookup
lookup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaLookup

public JavaLookup()
Method Detail

getHardware

public String getHardware()
Accessible through the Lookup key hw.

Returns:
hardware processor information.

getLocale

public String getLocale()
Accessible through the Lookup key locale.

Returns:
system locale and file encoding information.

getOperatingSystem

public String getOperatingSystem()
Accessible through the Lookup key os.

Returns:
operating system information.

getRuntime

public String getRuntime()
Accessible through the Lookup key runtime.

Returns:
Java Runtime Environment information.

getVirtualMachine

public String getVirtualMachine()
Accessible through the Lookup key vm.

Returns:
Java Virtual Machine information.

lookup

public String lookup(LogEvent event,
                     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.


Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.