bbarker
bbarker

Reputation: 13078

Is it possible to enable query logging in Cassandra 3.11?

Specifically, Cassandra 3.11.4?

I don't care about performance as this is not currently a production system (in the fullest sense). So for instance, I don't require FQL's performant features that are available in 4.0, which sound like they may be suitable for logging on production systems.

What I would like is some way to do query logging, so I can debug what queries my application is sending to my system (which seem to be incorrect).

Upvotes: 1

Views: 1060

Answers (2)

Aaron
Aaron

Reputation: 57748

I have had good success with Ericsson's ecAudit plugin.

Here's the repo: https://github.com/Ericsson/ecaudit

To configure it:

  • Download their 3.11 jar, and copy it to your $CASSANDRA_HOME/lib/ dir.
  • Reference it from within your cassandra-env.sh file:

JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Dcassandra.custom_query_handler_class=com.ericsson.bss.cassandra.ecaudit.handler.AuditQueryHandler"

  • In the cassandra.yaml, switch-out the default CassandraRoleManager to use theirs:

role_manager: com.ericsson.bss.cassandra.ecaudit.auth.AuditRoleManager

Upvotes: 1

user6238251
user6238251

Reputation: 66

Yes it’s possible Enable nodetool settraceprobability 1.0 You can find the query in system_traces.events table

Other option is increasing the logging levels to all and grep “native transport request -Id

Upvotes: 1

Related Questions