Class DateLookup

  • All Implemented Interfaces:
    StrLookup

    @Plugin(name="date",
            category="Lookup")
    public class DateLookup
    extends Object
    implements StrLookup
    Formats the current date or the date in the LogEvent. The "key" is used as the format String.
    • Constructor Detail

      • DateLookup

        public DateLookup()
    • Method Detail

      • lookup

        public String lookup​(String key)
        Looks up the value of the environment variable.
        Specified by:
        lookup in interface StrLookup
        Parameters:
        key - the format to use. If null, the default DateFormat will be used.
        Returns:
        The value of the environment variable.
      • lookup

        public String lookup​(LogEvent event,
                             String key)
        Looks up the value of the environment variable.
        Specified by:
        lookup in interface StrLookup
        Parameters:
        event - The current LogEvent (is ignored by this StrLookup).
        key - the format to use. If null, the default DateFormat will be used.
        Returns:
        The value of the environment variable.