Cassandra vs logging activity

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 03:45:09

问题


I'm using Cassandra with Kundera. My question is easy... Is any way to log all queries / request to Cassandra ? I'd like to know what exactly happens on server site :)

Regards

Tom


回答1:


Enable DEBUG logging for org.apache.cassandra.thrift.CassandraServer




回答2:


Enable DEBUG logging for org.apache.cassandra.transport.Message:

log4j.logger.org.apache.cassandra.transport.Message=DEBUG

This logs only PreparedStatements!!

for example:

DEBUG [Native-Transport-Requests:167] 2015-06-01 15:56:15,186 Message.java (line 302) Received: PREPARE INSERT INTO dba_test.cust_view (leid, vid, geoarea, ver) VALUES (?, ?, ?, ?);, v=2 TRACE [Native-Transport-Requests:167] 2015-06-01 15:56:15,187 QueryProcessor.java (line 283) Stored prepared statement 61956319a6d7c84c25414c96edf6e38c with 4 bind markers DEBUG [Native-Transport-Requests:167] 2015-06-01 15:56:15,187 Tracing.java (line 159) request complete DEBUG [Native-Transport-Requests:167] 2015-06-01 15:56:15,187 Message.java (line 309) Responding: RESULT PREPARED 61956319a6d7c84c25414c96edf6e38c [leid(dba_test, cust_view), org.apache.cassandra.db.marshal.UTF8Type][vid(dba_test, cust_view), org.apache.cassandra.db.marshal.UTF8Type][geoarea(dba_test, cust_view), org.apache.cassandra.db.marshal.UTF8Type][ver(dba_test, cust_view), org.apache.cassandra.db.marshal.LongType] (resultMetadata=[0 columns]), v=2



来源:https://stackoverflow.com/questions/9604554/cassandra-vs-logging-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!