tikal -trace in Eclipse logger issue
Issue #698
resolved
When tikal is run with -trace
flag from Eclipse IDE, an error message Error: Unknown underlying logger, cannot capture it's output
is shown in console at the beginning of the run.
Some logging messages are shown in the Console window but not all of them seem to be shown.
Comments (2)
-
reporter -
- changed status to resolved
There is no output to console and
System.out.println()
anymore, everything goes through the logger.And since we switched the development logger to
logback
(2018-08-23, commit45c126f067
) this works, because Eclipse also useslogback
. - Log in to comment
It seems I am supposed to use the
-logger
argument to use the real logger.Without
-logger
, it tries to use it's own log adaptor class, either LongHandlerJDK or LogHandlerNone. LogHandlerJDK does send the messages to the console by System.out.println() and LogHandlerNone does nothing.So the only time the log messages will be displayed is when LogHandlerJDK is chosen. The choice is made by the LogHandlerFactory class in /okapi-application-tikal/src/main/java/net/sf/okapi/applications/tikal/logger. For this to happen the Slf4J implementation class must be org.slf4j.impl.JDK14LoggerAdapter. And that requires slf4j-jdk14.jar is in the runtime classpath. But tikal/pom.xml is using slf4j-simple.jar through the dependencies. Because of that LogHandlerNone is chosen and the logging messages are simply ignored.
The installation image found in okapi/deployment/maven/dist_cocoa-macosx-x86_64-dmg/Okapi_0.36-SNAPSHOT after running /deployment/maven/update-and-rebuild-macosx.sh indicaes that tikal.sh after installation uses JDK Logger found in lib/logger directory.
The right thing to do seems to replace the dependency on slf4j-simple with slf4j-jdk14. There are three pom.xml files found referencing slf4j-simple: