Package org.apache.uima.util.impl
Class Logger_common_impl
java.lang.Object
org.apache.uima.util.impl.Logger_common_impl
- All Implemented Interfaces:
Logger,org.slf4j.Logger
- Direct Known Subclasses:
JSR47Logger_impl,Log4jLogger_impl,Logger_impl,Slf4jLogger_impl
UIMA Logging interface common implementation Specific loggers extend this class
Logging "location" information:
- This is the Classname / Methodname / and maybe line number where the logging statement is
- is passed in on the logrb calls, but is not needed by modern loggers.
- In V3, passed in value is ignored; loggers get what they need as configured.
- In Java 9 this will be efficient
Limiting or throttling loggers: This is normally done using logger configuration. For cases where UIMA is running as an embedded library, sometimes Annotators log excessivly, and users do not have access to the logging configuration. But they do have access to APIs which create the UIMA pipelines.
V3 supports an additional param, AnalysisEngine.PARAM_THROTTLE_EXCESSIVE_ANNOTATOR_LOGGING which if set, specifies a limit of the number of log messages issued by Annotator code.
This requires:
- marking loggers if they are Annotator loggers (e.g., their associated "class" used in setting the name of the logger, is assignable to AnalysisComponent_ImplBase, which includes: Annotators, CasMultipliers, and UimacppAnalysisComponents.
- When setting up a logger in the UimaContext logger code (via setLogger), checking if the logger is an Annotator logger, and if so, setting the limit on it from the parameter associated with the UIMA context.
The loggers with a limit are cloned for the particular pipeline (represented by the root UIMA context), so that setting the limit only affects one pipeline.
The common part of logging does:
- optional throttling
- the UIMA specific resource bundle message conversions
- the conversion of variants of log methods to standard ones
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String[]protected static final Stringprotected final Stringprotected final Stringprotected final intFields inherited from interface org.apache.uima.util.Logger
UIMA_MARKER_CONFIG, UIMA_MARKER_FINESTFields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLogger_common_impl(Class<?> component) protectedLogger_common_impl(Logger_common_impl lci, int limit) Copy constructor for limited loggers -
Method Summary
Modifier and TypeMethodDescriptionvoidConvert standard call varietiesvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidstatic org.slf4j.MarkergetMarkerForLevel(Level level) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidbooleanThis is true if the name of the logger corresponds to a class which implements AnalysisComponent_ImplBase, which includes basic Annotators, plus Cas Multipliers and CPP components.protected booleanvoidDeprecated.use new function with log levelvoidDeprecated.use new function with log levelvoidConvert a standard UIMA call for wrapped loggersvoidLogs a message.voidLogs a message with one parametervoidLogs a message with an arbitrary number of parametersvoidLogs a message and a throwable objectabstract voidlog(org.slf4j.Marker m, String aFqcn, Level level, String message, Object[] args, Throwable throwable) The main log call implemented by subclassesabstract voidThe version of the main log call implemented by subclasses that skips the substitution because it already was done by rb()abstract voidlog2(org.slf4j.Marker m, String aFqcn, Level level, String message, Object[] args, Throwable throwable) The version of the main log call implemented by subclasses that uses {}, not {n} as the substitutable syntax.voidlogException(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.Get an internationalized message from a resource bundle by key name, substituting the parameters.voidsetAnnotatorLogger(boolean v) voidDeprecated.use external configuration possibilityvoidDeprecated.use external configuration possibilityvoidsetResourceManager(ResourceManager resourceManager) Deprecated.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.uima.util.Logger
getLimitedLogger, isLoggable, isLoggable, rb_ue, setLevelMethods inherited from interface org.slf4j.Logger
getName, isDebugEnabled, isDebugEnabled, isErrorEnabled, isErrorEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled
-
Field Details
-
EXCEPTION_MESSAGE
- See Also:
-
EMPTY_STACK_TRACE_INFO
-
fqcn
-
fqcnCmn
-
limit_common
protected final int limit_common
-
-
Constructor Details
-
Logger_common_impl
-
Logger_common_impl
Copy constructor for limited loggers- Parameters:
lci- the original logger to copylimit- the limit
-
-
Method Details
-
log
public abstract void log(org.slf4j.Marker m, String aFqcn, Level level, String message, Object[] args, Throwable throwable) The main log call implemented by subclasses- Parameters:
m- the markeraFqcn- the fully qualified class name of the top-most logging class used to filter the stack trace to get the caller class / method infolevel- the UIMA levelmessage- -args- - arguments to be substituted into the messagethrowable- - can be null
-
log2
public abstract void log2(org.slf4j.Marker m, String aFqcn, Level level, String message, Object[] args, Throwable throwable) The version of the main log call implemented by subclasses that uses {}, not {n} as the substitutable syntax. This syntax is used by log4j, slf4j, and others. But not used by uimaj logger basic syntax, or Java Util Logger. This version is called by all new logging statments that don't need to be backwards compatible. e.g. logger.info, logger.error, logger.warn, etc.- Parameters:
m- the markeraFqcn- the fully qualified class name of the top-most logging class used to filter the stack trace to get the caller class / method infolevel- the UIMA levelmessage- -args- - arguments to be substituted into the messagethrowable- - can be null
-
log
public abstract void log(org.slf4j.Marker m, String aFqcn, Level level, String message, Throwable throwable) The version of the main log call implemented by subclasses that skips the substitution because it already was done by rb()- Parameters:
m- the markeraFqcn- the fully qualified class name of the top-most logging class used to filter the stack trace to get the caller class / method infolevel- the UIMA levelmessage- -throwable- - can be null
-
getMarkerForLevel
- Parameters:
level- the Uima Level- Returns:
- the Marker to use
-
log
Convert a standard UIMA call for wrapped loggers -
setOutputStream
Deprecated.use external configuration possibilityDescription copied from interface:LoggerSets the output stream to which log messages will go. Setting the output stream tonullwill disable the logger.- Specified by:
setOutputStreamin interfaceLogger- Parameters:
out-OutputStreamto which log messages will be printed- See Also:
-
setOutputStream
Deprecated.use external configuration possibilityDescription copied from interface:LoggerSets the output stream to which log messages will go. Setting the output stream tonullwill disable the logger.- Specified by:
setOutputStreamin interfaceLogger- Parameters:
out-PrintStreamto which log messages will be printed- See Also:
-
log
Deprecated.use new function with log levelLogs a message with level INFO. -
log
Deprecated.use new function with log levelLogs a message with a message key and the level INFO -
logException
Deprecated.use new function with log levelLogs an exception with level INFO- Specified by:
logExceptionin interfaceLogger- Parameters:
aException- the exception to be logged
-
log
Description copied from interface:LoggerLogs a message. -
log
Description copied from interface:LoggerLogs a message with one parameter -
log
Description copied from interface:LoggerLogs a message with an arbitrary number of parameters -
log
Description copied from interface:LoggerLogs a message and a throwable object -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object param1) Description copied from interface:LoggerLogs a message with a message key and one parameter. The real message is extracted from a resource bundle. -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object[] params) Description copied from interface:LoggerLogs a message with a message key and an arbitrary number of parameters. The real message is extracted from a resource bundle. -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Throwable thrown) Description copied from interface:LoggerLogs a message with a message key and a throwable object. The real message is extracted from a resource bundle. -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey) Description copied from interface:LoggerLogs a message with a message key. The real message is extracted from a resource bundle. -
setResourceManager
Deprecated.Description copied from interface:LoggerSets the ResourceManager to use for message localization. This method is intended for use by the framework, not by user code.- Specified by:
setResourceManagerin interfaceLogger- Parameters:
resourceManager- A resource manager instance whose extension ClassLoader (if any) will be used for message localization by this logger.
-
rb
Description copied from interface:LoggerGet an internationalized message from a resource bundle by key name, substituting the parameters. This should be called via a Supplier to avoid computing this until needed -
isEmpty
-
isAnnotatorLogger
public boolean isAnnotatorLogger()Description copied from interface:LoggerThis is true if the name of the logger corresponds to a class which implements AnalysisComponent_ImplBase, which includes basic Annotators, plus Cas Multipliers and CPP components.- Specified by:
isAnnotatorLoggerin interfaceLogger- Returns:
- true if this logger is an Annotator logger.
-
setAnnotatorLogger
public void setAnnotatorLogger(boolean v) -
debug
Convert standard call varieties- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
-
debug
-
debug
-
debug
-
debug
-
debug
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
-
error
-
error
-
error
-
error
-
error
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
-
info
-
info
-
info
- Parameters:
message- the message to logparamSuppliers- An array of functions, which when called, produce the desired log message parameters.
-
info
-
info
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
-
trace
-
trace
-
trace
-
trace
-
trace
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
-
warn
-
warn
-
warn
-
warn
-
warn
-