Package org.glassfish.api.logging
Class LogHelper
java.lang.Object
org.glassfish.api.logging.LogHelper
Class providing helper APIs for logging purposes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFormattedMessage
(Logger logger, String msgKey, Object... params) Gets the formatted message given the message key and parameters.static void
Logs 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
- theLogger
object to be used for logging the message.level
- theLevel
of the message to be logged.messageId
- the key in the resource bundle of theLogger
containing the localized text.thrown
- theThrowable
associated 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:
-