Class LogInput

java.lang.Object
codes.grow.packages.graylog.logging.LogInput
All Implemented Interfaces:
LogEntry

public final class LogInput extends Object implements LogEntry
Short form of a log record: a message plus optional severity, attributes, timestamp and trace ids. The LogClient fills in the timestamp, the resource and (when a span is active) the trace correlation.
  • Method Details

    • of

      public static LogInput of(String message)
      Creates an INFO input with no attributes.
      Parameters:
      message - the message
      Returns:
      the input
    • of

      public static LogInput of(Severity severity, String message, Map<String,?> attributes)
      Creates an input with a severity and attributes.
      Parameters:
      severity - severity
      message - the message
      attributes - attributes (may be null)
      Returns:
      the input
    • builder

      public static LogInput.Builder builder(String message)
      Returns a builder for message.
      Parameters:
      message - the message
      Returns:
      builder
    • message

      public String message()
      Message.
      Returns:
      message
    • severity

      public Severity severity()
      Severity (default INFO).
      Returns:
      severity
    • attributes

      public Map<String,Object> attributes()
      Attributes.
      Returns:
      immutable attributes
    • timestamp

      public Optional<Instant> timestamp()
      Event time.
      Returns:
      timestamp, if set
    • traceId

      public Optional<String> traceId()
      Trace id.
      Returns:
      trace id, if set
    • spanId

      public Optional<String> spanId()
      Span id.
      Returns:
      span id, if set
    • toString

      public String toString()
      Overrides:
      toString in class Object