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
Modifier and TypeFieldDescriptionprotected static final String[]
protected static final String
protected final String
protected final String
protected final int
Fields inherited from interface org.apache.uima.util.Logger
UIMA_MARKER_CONFIG, UIMA_MARKER_FINEST
Fields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME
-
Constructor Summary
ModifierConstructorDescriptionprotected
Logger_common_impl
(Class<?> component) protected
Logger_common_impl
(Logger_common_impl lci, int limit) Copy constructor for limited loggers -
Method Summary
Modifier and TypeMethodDescriptionvoid
Convert standard call varietiesvoid
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
static org.slf4j.Marker
getMarkerForLevel
(Level level) void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
boolean
This 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 boolean
void
Deprecated.use new function with log levelvoid
Deprecated.use new function with log levelvoid
Convert a standard UIMA call for wrapped loggersvoid
Logs a message.void
Logs a message with one parametervoid
Logs a message with an arbitrary number of parametersvoid
Logs a message and a throwable objectabstract void
log
(org.slf4j.Marker m, String aFqcn, Level level, String message, Object[] args, Throwable throwable) The main log call implemented by subclassesabstract void
The version of the main log call implemented by subclasses that skips the substitution because it already was done by rb()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.void
logException
(Exception aException) Deprecated.use new function with log levelvoid
Logs a message with a message key.void
logrb
(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object param1) Logs a message with a message key and one parameter.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.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.Get an internationalized message from a resource bundle by key name, substituting the parameters.void
setAnnotatorLogger
(boolean v) void
Deprecated.use external configuration possibilityvoid
Deprecated.use external configuration possibilityvoid
setResourceManager
(ResourceManager resourceManager) Deprecated.void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.uima.util.Logger
getLimitedLogger, isLoggable, isLoggable, rb_ue, setLevel
Methods 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:Logger
Sets the output stream to which log messages will go. Setting the output stream tonull
will disable the logger.- Specified by:
setOutputStream
in interfaceLogger
- Parameters:
out
-OutputStream
to which log messages will be printed- See Also:
-
setOutputStream
Deprecated.use external configuration possibilityDescription copied from interface:Logger
Sets the output stream to which log messages will go. Setting the output stream tonull
will disable the logger.- Specified by:
setOutputStream
in interfaceLogger
- Parameters:
out
-PrintStream
to which log messages will be printed- See Also:
-
log
Deprecated.use new function with log levelLogs a message with level INFO. -
log
@Deprecated(since="2.3.1") public void log(String aResourceBundleName, String aMessageKey, Object[] aArguments) 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:
logException
in interfaceLogger
- Parameters:
aException
- the exception to be logged
-
log
Description copied from interface:Logger
Logs a message. -
log
Description copied from interface:Logger
Logs a message with one parameter -
log
Description copied from interface:Logger
Logs a message with an arbitrary number of parameters -
log
Description copied from interface:Logger
Logs 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:Logger
Logs 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:Logger
Logs 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:Logger
Logs 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:Logger
Logs a message with a message key. The real message is extracted from a resource bundle. -
setResourceManager
Deprecated.Description copied from interface:Logger
Sets the ResourceManager to use for message localization. This method is intended for use by the framework, not by user code.- Specified by:
setResourceManager
in 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:Logger
Get 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:Logger
This 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:
isAnnotatorLogger
in interfaceLogger
- Returns:
- true if this logger is an Annotator logger.
-
setAnnotatorLogger
public void setAnnotatorLogger(boolean v) -
debug
Convert standard call varieties- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
-
debug
-
debug
-
debug
-
debug
-
debug
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
-
error
-
error
-
error
-
error
-
error
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in 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:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
-
trace
-
trace
-
trace
-
trace
-
trace
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
-
warn
-
warn
-
warn
-
warn
-
warn
-