You can enable logging in an extension to provide diagnostic information about the extension as it runs in an acquisition. An extension writes to the <install path>\CAS\workspace\logs\cas-service.log file using one of the common logging frameworks.
Oracle recommends the SLF4J framework because its parameterized logging minimizes the performance impact of disabled logging statements. For details, see the SLF4J documentation at http://www.slf4j.org.
Integration is largely transparent. You import the logging framework into the PipelineComponentRuntime and call getLogger(). If any logging requests come in from any of the frameworks, the Content Acquisition System detects the requests and redirects them to Log4J which CAS then uses to write to cas-service.log.
import org.slf4j.LoggerFactory ... LoggerFactory.getLogger(getClass()).info("A logging message.");
You can change log levels by modifying log4j.logger.loggerName properties in <install path>\CAS\workspace\conf\cas-service-log4j.properties. The default log level is set to WARN.
log4j.logger.com.endeca.cas.extension.sample.manipulator.substring.SubstringManipulatorRuntime=DEBUG
After you modify, save, and close the cas-service-log4j.properties file, you must restart the Endeca CAS Service for the change to take effect.
Data sources include several advanced configuration properties by default: you do not need to implement these properties as Java fields in an PipelineComponentConfiguration class. An application developer can set these properties using the CAS Server Command-line Utility, the CAS Server API, and in the CAS Console (on the Advanced Settings tab). The log level setting applies to high-level aspects of a data acquisition, such as logging crawl history, but the log level setting does not apply to the data source extension itself.