Class InsertId

java.lang.Object
eu.mulk.quarkus.googlecloud.jsonlogging.InsertId

public final class InsertId extends Object
A unique identifier for a log entry.

Prevents the duplicate insertion of log entries. Also serves as a discriminator to order log entries that carry the same time stamp.

Will be generated by Google Cloud Logging if not provided.

Instances of InsertId can be passed as log parameters to the *f family of logging functions on Logger.

Example:

logger.logf("Request rejected: unauthorized.", InsertId.of("123"));

Result:

{
  "textPayload": "Request rejected: unauthorized.",
  "logging.googleapis.com/insertId": "123"
}
See Also:
  • Method Details

    • of

      public static InsertId of(String value)
      Constructs an InsertId from a string.
      Parameters:
      value - the value of the insertion ID.
      Returns:
      the newly constructed InsertId, ready to be passed to a logging function.
    • value

      public String value()
      The value of the label.
      Returns:
      the value of the label.
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object