Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.2.0
-
None
-
None
Description
TikaCLI directly invokes a Log4J2 API to set the log level when it should be setting the log level using SLF4J, something like ...
System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
This tightly couples the CLI to Log4J2 and makes it hard to use another logging framework that may differ in any ingesting app.
Moreover, the implication of this ticket is that perhaps Log4J2 should be removed from the CLI, especially since it is only logging to `CONSOLE`. SLF4J's SimpleLogger logs to stdout by default and can be easily replaced with a different logging mechanism.
Since Log4J2 doesn't refresh default logging levels between calls and after instantiation (as I understand), setting a System Property probably won't work for Log4J2, but it does work for SLF4Js SimpleLogger.