tikal -trace in Eclipse logger issue

Issue #698 resolved
Kuro Kurosaka created an issue

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)

  1. Kuro Kurosaka reporter

    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:

    ./okapi/pom.xml:            <artifactId>slf4j-simple</artifactId>
    ./okapi/tm/pensieve-server/pom.xml:         <artifactId>slf4j-simple</artifactId>
    ./superpom/pom.xml:             <artifactId>slf4j-simple</artifactId>
    
  2. Mihai Nita

    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, commit 45c126f067) this works, because Eclipse also uses logback.

  3. Log in to comment