Class DateLookup
- java.lang.Object
-
- org.apache.logging.log4j.core.lookup.DateLookup
-
- All Implemented Interfaces:
StrLookup
@Plugin(name="date", category="Lookup") public class DateLookup extends java.lang.Object implements StrLookup
Formats the current date or the date in the LogEvent. The "key" is used as the format String, following the java.text.SimpleDateFormat date and time pattern strings.
-
-
Constructor Summary
Constructors Constructor Description DateLookup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringformatDate(long date, java.lang.String format)java.lang.Stringlookup(java.lang.String key)Looks up the current date.java.lang.Stringlookup(LogEvent event, java.lang.String key)Looks up d the current date or the date in the LogEvent.
-
-
-
Method Detail
-
lookup
public java.lang.String lookup(java.lang.String key)
Looks up the current date.
-
lookup
public java.lang.String lookup(LogEvent event, java.lang.String key)
Looks up d the current date or the date in the LogEvent.
-
formatDate
private java.lang.String formatDate(long date, java.lang.String format)
-
-