Cassandra 4.x full query logging enables you to get the exact CQL query strings used by your client applications. This information can be used for:
- Analyzing poorly performing queries
- Debugging queries that are producing incorrect results
- Live traffic capture and replay
In this scenario you will:
- Enable and disable full query logging statically (in cassandra.yaml) and dynamically (using nodetool).
- Learn features of the full query logging tool fqltool
- Read and interpret full query logs
Full Query Logging
Enable Full Query Logging via nodetool
In this step, you will enable full query logging via nodetool.
We've already started a single node Cassandra cluster for you in the background. When the command prompt appears in the terminal, the node is initialized and ready to go.
First, let's create a directory to store our full query log files:
Now you can connect to the node using nodetool and enable full query logging, using the directory we just created as the path:
nodetool enablefullquerylog --path /tmp/fqllogs
To get a listing of the other options available on this command, execute the following:
nodetool help enablefullquerylog
In this step, you enabled full query logging dynamically on a running Cassandra node using nodetool and learned about the available options on the