Here's a next iteration of set of ideas for logging support in V3. 1) Keep the v2 uima logging API - so users can migrate at their own speed (or not...) - but update the UIMA logger logj4 backend to switch it to log4j-2
2) Add SLF4j as a "facade" that supports log4j-2, logback and other back-end loggers, configurable at deployment time. - Has MDC and NDC (the stack version of MDC) support https://logback.qos.ch/manual/mdc.html - Has support for efficiency and Java 8 styles (e.g. using "Supplier<String>" for messages) - Has support for Markers http://stackoverflow.com/questions/4165558/best-practices-for-using-markers-in-slf4j-logback 3) For Annotators, the base class they extend is augmented with getLogger() and getSlf4jLogger(); these return either the UIMA logger or an SLF4j logger with the name of the Annotator implementation class. getLogger() is just shorthand for the existing getContext().getLogger() api. 4) Extend the UIMA logger to externalize the hook to UIMA's resource bundle message lookup (which uses the context's ResourceManger's extension class loader if defined), so calls using the slf4j apis can use that if desired. 5) Update the existing documentation on how to configure backends to mention slf4j. 6) A plan to make use of the the slf4j logging in core UIMA. I'm new to this, so please make suggestions for improvement! a) Add to MDC: the Annotator being run (probably just the class name) There are probably other things that should go into the MDC/NDC, but I'm not sure what would be useful - suggestions welcome. b) Use Markers to identify and control logging related to: - annotator (flow-like tracing?) - flow_controller - feature structure (creation, updating) - trace-level - index (operations like adding to / removing from) -trace-level - index_copy_on_write - trace-level - index_auto_rmv_add (when UIMA is automatically removing and adding back FSs due to modification of key values) - trace-level - serdes (serialization / deserialization) Please consider this a first try; other suggestions welcome :-) -Marshall
