我们正在使用 AbstractCassandraConfiguration
来配置 cassandra 实体
,有没有办法使用 application.properties
记录应用程序执行的查询?
谢谢。
最佳答案
是的,有多种方法:
- 如果您使用 Spring Data for Apache Cassandra 2.0 或更高版本,则可以使用日志记录配置来激活 CQL 日志记录。将
org.springframework.data.cassandra.core.cql.CqlTemplate
的日志级别设置为DEBUG
。 - 在任何其他情况下(或代替 1.),请使用直接附加到
Cluster
对象的QueryLogger
。请参阅What is a good way to discover all queries made by a Cassandra java app?了解更多详情。
关于java - Spring Data Cassandra 执行的日志查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53322089/