nodetool getlogginglevels
Displays the current logging levels for all loggers.
Synopsis
Section titled “Synopsis”nodetool [connection_options] getlogginglevelsSee connection options for connection options.
Description
Section titled “Description”nodetool getlogginglevels shows all loggers that have been explicitly configured with non-default logging levels. This includes both levels set at runtime via setlogginglevel and levels configured in logback.xml.
Output Format
Section titled “Output Format”Logger Name Log LevelROOT INFOorg.apache.cassandra.db.compaction DEBUGorg.apache.cassandra.gms DEBUGExamples
Section titled “Examples”View Current Levels
Section titled “View Current Levels”nodetool getlogginglevelsFilter for Specific Package
Section titled “Filter for Specific Package”nodetool getlogginglevels | grep compactionCheck if Debug is Enabled
Section titled “Check if Debug is Enabled”nodetool getlogginglevels | grep DEBUGUse Cases
Section titled “Use Cases”Verify Debug Settings
Section titled “Verify Debug Settings”After enabling debug logging:
# Enable debugnodetool setlogginglevel org.apache.cassandra.repair DEBUG
# Verify it's setnodetool getlogginglevels | grep repairAudit Logging Configuration
Section titled “Audit Logging Configuration”# See all non-default loggersnodetool getlogginglevelsBefore Node Restart
Section titled “Before Node Restart”# Document current debug settings (they don't persist)nodetool getlogginglevels > /tmp/logging_levels_backup.txtUnderstanding Output
Section titled “Understanding Output”ROOT Logger
Section titled “ROOT Logger”ROOT INFOThe root logger affects all classes not explicitly configured.
Package Loggers
Section titled “Package Loggers”org.apache.cassandra.db DEBUGAll classes under this package inherit this level.
Class Loggers
Section titled “Class Loggers”org.apache.cassandra.db.compaction.CompactionManager TRACESpecific class with its own level.
Common Logger Packages
Section titled “Common Logger Packages”| Package | Purpose |
|---|---|
org.apache.cassandra.db | Database operations |
org.apache.cassandra.db.compaction | Compaction |
org.apache.cassandra.gms | Gossip |
org.apache.cassandra.net | Networking |
org.apache.cassandra.repair | Repair |
org.apache.cassandra.streaming | Streaming |
org.apache.cassandra.hints | Hinted handoff |
org.apache.cassandra.auth | Authentication |
org.apache.cassandra.transport | CQL protocol |
Workflow: Troubleshooting Session
Section titled “Workflow: Troubleshooting Session”# 1. Check current statenodetool getlogginglevels
# 2. Enable needed debug levelsnodetool setlogginglevel org.apache.cassandra.repair DEBUGnodetool setlogginglevel org.apache.cassandra.streaming DEBUG
# 3. Verify enablednodetool getlogginglevels
# 4. Debug the issue...
# 5. Reset all debug levelsnodetool setlogginglevel org.apache.cassandra.repair INFOnodetool setlogginglevel org.apache.cassandra.streaming INFO
# 6. Confirm resetnodetool getlogginglevelsScripting Example
Section titled “Scripting Example”#!/bin/bash# check_debug_logging.sh - Alert if debug logging is enabled
DEBUG_COUNT=$(nodetool getlogginglevels | grep -c "DEBUG\|TRACE")
if [ "$DEBUG_COUNT" -gt 0 ]; then echo "WARNING: $DEBUG_COUNT logger(s) at DEBUG/TRACE level" nodetool getlogginglevels | grep "DEBUG\|TRACE"else echo "OK: No debug logging enabled"fiReset All to Defaults
Section titled “Reset All to Defaults”#!/bin/bash# reset_logging.sh - Reset all loggers to INFO
for logger in $(nodetool getlogginglevels | grep -v "^Logger\|^ROOT" | awk '{print $1}'); do echo "Resetting $logger to INFO" nodetool setlogginglevel "$logger" INFOdonePersistence Note
Section titled “Persistence Note”Runtime Configuration
Levels shown by getlogginglevels include:
- Runtime changes via
setlogginglevel(not persisted) - Static configuration from
logback.xml(persisted)
After restart, only logback.xml settings remain.
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| setlogginglevel | Change logging levels |
| info | General node information |