KB Article #194860

Enable Metrics query logging

Problem

  • How to enable SQL query logging for MetricsDB based features: (Analytics, API Manager > Monitoring)
  • Existing QueryLogger entry in apigateway/system/conf/log4j2.yaml does not work.


Resolution

The Apache Cayenne library was updated to use a different logging class.

Modify apigateway/system/conf/log4j2.yaml, find the Cayenne section and add the bold lines. Make sure the change conforms to existing YAML formatting.

- level: false
# Default Logging configuration for Cayenne
name: org.apache.cayenne.access.QueryLogger
- level: info
name: org.apache.cayenne.log.JdbcEventLogger
- level: false
name: org.apache.cayenne.conf
- level: false
name: org.apache.cayenne.util


Instance trace level should also be at Info or higher.