Cayenne logging is based on Jakarta Apache commons-logging package. Commons-logging allows users to choose their own logging provider, such as Log4J or java.util.logging. Below is an example of a Log4J-based configuration of the most important Cayenne logger that turns on and off SQL tracing:

# Turn SQL tracing on
log4j.logger.org.apache.cayenne.access.QueryLogger = INFO

# Turn SQL tracing off, e.g. to increase performance
log4j.logger.org.apache.cayenne.access.QueryLogger = WARN

Another example shows how to trace Cayenne configuration loading. Cayenne XML files may contain errors, or maybe missing or inaccessible by the application; there maybe lots of other reasons why Cayenne fails to startup, from missing JDBC drivers to misspelled database URLs. This logger helps you to debug it:

log4j.logger.org.apache.cayenne.conf = DEBUG
log4j.logger.org.apache.cayenne.util = DEBUG