Package org.glassfish.api.logging
Class LogHelper
- java.lang.Object
-
- org.glassfish.api.logging.LogHelper
-
public final class LogHelper extends Object
Class providing helper APIs for logging purposes.
-
-
Constructor Summary
Constructors Constructor Description LogHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getFormattedMessage(Logger logger, String msgKey, Object... params)
Gets the formatted message given the message key and parameters.static void
log(Logger logger, Level level, String messageId, Throwable thrown, Object... params)
Logs a message with the given level, message, parameters andThrowable
.
-
-
-
Method Detail
-
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
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:
-
-