All Cyc APIs use the SLF4J logging API. This makes it much easier to integrate them with your preferred logging framework, but it also means that some configuration is necessary for the API to produce log output.
In particular, a logging framework must be added to your application’s classpath, along with the SLF4J binding jar for that logging framework. Without those components (and the SLF4J API jar) on your application’s classpath, the Cyc APIs will not log anything.
Note that, although the SLF4J API jar must always be available (as the Cyc APIs have direct dependencies upon them) the actual logging framework implementation need only be present at run time.
Make sure that slf4j-api jar, version 1.7.12 or higher (e.g., slf4j-api-1.7.12.jar), is on your classpath.
Find the appropriate SLF4J binding jar for your logging framework, and include it on your classpath. You can find a list of SLF4J bindings (for log4j, java.util.logging, Jakarta Commons Logging, etc.) in the “Binding with a logging framework at deployment time” section in the SLF4J manual.
For example, if you were using Jakarta Commons Logging v1.2, you’d need the following on your classpath:
Lastly, you’ll need to configure the logging framework to your preferred logging levels. See your logging framework documentation for details.
There are a lot of great logging frameworks out there; we tend to use log4j. To set up log4j 1.2:
Make sure that slf4j-api-1.7.12.jar is on your classpath.
Make sure that slf4j-log4j12-1.7.12.jar is on your classpath.
Download log4j 1.2.17 (or higher) and place it on your classpath.
Plage a log4j.properties file into the root of your classpath. You can download an example here.
That should be all that’s necessary. You may need to restart your application’s JVM).
The example log4j file provided should be sufficient to get you started, but for more details on configuring log4j, see: