Package org.glassfish.api.logging
Class LogHelper
java.lang.Object
org.glassfish.api.logging.LogHelper
Class providing helper APIs for logging purposes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetFormattedMessage(Logger logger, String msgKey, Object... params) Gets the formatted message given the message key and parameters.static voidLogs a message with the given level, message, parameters andThrowable.
-
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 andThrowable.- Parameters:
logger- theLoggerobject to be used for logging the message.level- theLevelof the message to be logged.messageId- the key in the resource bundle of theLoggercontaining the localized text.thrown- theThrowableassociated with the message to be logged.params- the parameters to the localized text.
-
getFormattedMessage
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:
-