Interface LogRecordBuilder

    • Method Detail

      • setTimestamp

        LogRecordBuilder setTimestamp​(long timestamp,
                                      java.util.concurrent.TimeUnit unit)
        Set the epoch timestamp, using the timestamp and unit.

        The timestamp is the time at which the log record occurred. If unset, it will be set to the current time when emit() is called.

      • setTimestamp

        LogRecordBuilder setTimestamp​(java.time.Instant instant)
        Set the epoch timestamp, using the instant.

        The timestamp is the time at which the log record occurred. If unset, it will be set to the current time when emit() is called.

      • setObservedTimestamp

        LogRecordBuilder setObservedTimestamp​(long timestamp,
                                              java.util.concurrent.TimeUnit unit)
        Set the epoch observedTimestamp, using the timestamp and unit.

        The observedTimestamp is the time at which the log record was observed. If unset, it will be set to the timestamp. observedTimestamp may be different from timestamp if logs are being processed asynchronously (e.g. from a file or on a different thread).

      • setObservedTimestamp

        LogRecordBuilder setObservedTimestamp​(java.time.Instant instant)
        Set the observedTimestamp, using the instant.

        The observedTimestamp is the time at which the log record was observed. If unset, it will be set to the timestamp. observedTimestamp may be different from timestamp if logs are being processed asynchronously (e.g. from a file or on a different thread).

      • setSeverityText

        LogRecordBuilder setSeverityText​(java.lang.String severityText)
        Set the severity text.
      • setAllAttributes

        default LogRecordBuilder setAllAttributes​(Attributes attributes)
        Sets attributes. If the LogRecordBuilder previously contained a mapping for any of the keys, the old values are replaced by the specified values.
      • emit

        void emit()
        Emit the log record.