Package org.apache.uima.util
Interface Logger
- All Known Implementing Classes:
JSR47Logger_impl,Log4jLogger_impl,Logger_impl
public interface Logger
A
Logger is a component used to log messages. This interface defines the standard
way for UIMA components to produce log output.
In the UIMA SDK, this interface is implemented using the Java 1.4 logger as a back end. If you want to configure the logger, for example to specify the location of the log file and the logging level, you should use the standard Java 1.4 logger properties or the java.util.logging APIs. See the section "Specifying the Logging Configuration" in the Annotator and Analysis Engine Developer's Guide chapter of the UIMA documentation for more information.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisLoggable(Level level) Checks if the argument level is greater or equal to the specified levelvoidDeprecated.use new function with log levelvoidDeprecated.use new function with log levelvoidGeneric logging method intended for logging wrappers.voidLogs a message.voidLogs a message with one parametervoidLogs a message with an arbitrary number of parametersvoidLogs a message and a throwable objectvoidlogException(Exception aException) Deprecated.use new function with log levelvoidLogs a message with a message key.voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object param1) Logs a message with a message key and one parameter.voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object[] params) Logs a message with a message key and an arbitrary number of parameters.voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Throwable thrown) Logs a message with a message key and a throwable object.voidSets the level of messages that will be logged by this logger.voidsetOutputStream(OutputStream aStream) Deprecated.use external configuration possibilityvoidsetOutputStream(PrintStream aStream) Deprecated.use external configuration possibilityvoidsetResourceManager(ResourceManager resourceManager) Sets the ResourceManager to use for message localization.
-
Method Details
-
log
Deprecated.use new function with log levelLogs a message.- Parameters:
aMessage- the message to be logged with message level INFO
-
log
Deprecated.use new function with log levelLogs an internationalized message.- Parameters:
aResourceBundleName- base name of resource bundleaMessageKey- key of message to localize with message level INFOaArguments- arguments to message (may be null if none)
-
logException
Deprecated.use new function with log levelLogs an exception- Parameters:
aException- the exception to be logged with message level INFO
-
setOutputStream
Deprecated.use external configuration possibilitySets the output stream to which log messages will go. Setting the output stream tonullwill disable the logger.- Parameters:
aStream-PrintStreamto which log messages will be printed
-
setOutputStream
Deprecated.use external configuration possibilitySets the output stream to which log messages will go. Setting the output stream tonullwill disable the logger.- Parameters:
aStream-OutputStreamto which log messages will be printed
-
log
Logs a message.- Parameters:
level- message levelaMessage- the message to be logged
-
log
Logs a message with one parameter- Parameters:
level- message levelaMessage- the message to be loggedparam1- message parameter
-
log
Logs a message with an arbitrary number of parameters- Parameters:
level- message levelaMessage- the message to be loggedparams- message parameter array
-
log
Logs a message and a throwable object- Parameters:
level- message levelaMessage- the message to be loggedthrown- throwable object
-
logrb
Logs a message with a message key. The real message is extracted from a resource bundle.- Parameters:
level- message levelsourceClass- source class namesourceMethod- source method namebundleName- resource bundlemsgKey- message key
-
logrb
void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object param1) Logs a message with a message key and one parameter. The real message is extracted from a resource bundle.- Parameters:
level- message levelsourceClass- source class namesourceMethod- source method namebundleName- resource bundlemsgKey- message keyparam1- message parameter
-
logrb
void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object[] params) Logs a message with a message key and an arbitrary number of parameters. The real message is extracted from a resource bundle.- Parameters:
level- message levelsourceClass- source class namesourceMethod- source method namebundleName- resource bundlemsgKey- message keyparams- message parameter array with an arbitrary number of parameters
-
logrb
void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Throwable thrown) Logs a message with a message key and a throwable object. The real message is extracted from a resource bundle.- Parameters:
level- message levelsourceClass- source class namesourceMethod- source method namebundleName- resource bundlemsgKey- message keythrown- throwable object
-
log
Generic logging method intended for logging wrappers.- Parameters:
wrapperFQCN- fully qualified class name of the wrapperlevel- message levelmessage- messagethrown- throwable object
-
isLoggable
Checks if the argument level is greater or equal to the specified level- Parameters:
level- message level- Returns:
- boolean - true if the argument level is greater or equal to the specified level
-
setLevel
Sets the level of messages that will be logged by this logger. Note that if you callUIMAFramework.getLogger().setLevel(level), this will only change the logging level for messages produced by the UIMA framework. It will NOT change the logging level for messages produced by annotators. To change the logging level for an annotator, useUIMAFramework.getLogger(YourAnnotatorClass.class).setLevel(level).If you need more flexibility it configuring the logger, consider using the standard Java logger properties file or the java.util.logging APIs.
- Parameters:
level- message level
-
setResourceManager
Sets the ResourceManager to use for message localization. This method is intended for use by the framework, not by user code.- Parameters:
resourceManager- A resource manager instance whose extension ClassLoader (if any) will be used for message localization by this logger.
-