Class LogMessage

java.lang.Object
com.codingchili.core.logging.LogMessage

public class LogMessage extends Object
Helper class to construct logging messages.
  • Method Details

    • level

      public LogMessage level(Level level)
      Parameters:
      level - the logging level to set for the message.
      Returns:
      fluent
    • put

      public LogMessage put(String key, Object value)
      Adds a new value to the log message as a key-value pair.
      Parameters:
      key - the key of the value to add
      value - the value to add for the given key
      Returns:
      fluent
    • send

      public Logger send()
      Commits the logging message.
      Returns:
      the logger that was used to send the message.
    • send

      public Logger send(String message)
      Commits the logging message with a message.
      Parameters:
      message - the message to include.
      Returns:
      the logger that was used to send the message.
    • toJson

      public io.vertx.core.json.JsonObject toJson()
      Converts the logging event into a json object.
      Returns:
      a json object representing the logging event.