Class LogHelper

java.lang.Object
org.glassfish.api.logging.LogHelper

public final class LogHelper extends Object
Class providing helper APIs for logging purposes.
  • Constructor Details

    • LogHelper

      public LogHelper()
  • Method Details

    • log

      public static void log(Logger logger, Level level, String messageId, Throwable thrown, Object... params)
      Logs a message with the given level, message, parameters and Throwable.
      Parameters:
      logger - the Logger object to be used for logging the message.
      level - the Level of the message to be logged.
      messageId - the key in the resource bundle of the Logger containing the localized text.
      thrown - the Throwable associated with the message to be logged.
      params - the parameters to the localized text.
    • getFormattedMessage

      public static String getFormattedMessage(Logger logger, String msgKey, Object... params)
      Gets the formatted message given the message key and parameters. The ResourceBundle associated with the logger is searched for the specified key.
      Parameters:
      logger -
      msgKey -
      params -
      Returns: