Class JsonEventFormatter.Builder

    • Method Detail

      • addMetaData

        public JsonEventFormatter.Builder addMetaData​(String key,
                                                      Object value)
        Adds meta-data to the final output.
        Parameters:
        key - the key to add
        value - the value for the key
        Returns:
        this builder
      • setTimestampKey

        public JsonEventFormatter.Builder setTimestampKey​(String timestampKey)
        Sets the key for the timestamp for the event. The default is timestamp.
        Parameters:
        timestampKey - the key name or null to revert to the default
        Returns:
        this builder
      • setTimestampFormatter

        public JsonEventFormatter.Builder setTimestampFormatter​(DateTimeFormatter formatter)
        Set the formatter used to format the timestamp on the event. The default is ISO-8601.

        Note the zone id is zone id on the formatter.

        Parameters:
        formatter - the formatter to use or null to revert to the default.
        Returns:
        this builder
      • setIncludeTimestamp

        public JsonEventFormatter.Builder setIncludeTimestamp​(boolean includeTimestamp)
        Sets whether or not the timestamp should be added to the output. The default is true. If set to false the zone id and format are ignored.
        Parameters:
        includeTimestamp - true to include the timestamp or false to leave the timestamp off
        Returns:
        this builder