Stability‎ > ‎Cassandra‎ > ‎How To‎ > ‎

Where are Cassandra Logs?

Generally Cassandra Logs are located here:

There are three types of Log files:
  1. cassandra.out
  2. system.log
  3. gc-<number>.log

Log File: /var/log/cassandra/cassandra.out

  • This is the log where cassandra writes to during startup
  • This log is relevant to see if cassandra started up ok

Log File: /var/log/cassandra/system.log

  • This is the general log file for cassandra.
  • The amount of logging to this file is controlled by the config file ~cassandra/current/conf/
  • For details of how to set the log level, refer here
  • For details of various Log messages in this file, refer to here

Log File: /var/log/cassandra/gc-<number>.log
  • The GC (garbage collector) in JVM writes output to this log.
  • The output format is determined by the following configs in ~cassandra/current/conf/
    • # GC logging options -- uncomment to enable
      JVM_OPTS="$JVM_OPTS -XX:+PrintGCDetails"
      JVM_OPTS="$JVM_OPTS -XX:+PrintGCTimeStamps"
      # JVM_OPTS="$JVM_OPTS -XX:+PrintClassHistogram"
      JVM_OPTS="$JVM_OPTS -XX:+PrintTenuringDistribution"
      # JVM_OPTS="$JVM_OPTS -XX:+PrintGCApplicationStoppedTime"
      JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc-`date +%s`.log"
  • A typical entry in this log file would be:
    • 4310549.766: [GC 4310549.767: [ParNew
      Desired survivor size 53673984 bytes, new threshold 1 (max 1)
      - age   1:   14069856 bytes,   14069856 total
      : 856488K->17112K(943744K), 0.0557850 secs] 3149531K->2323352K(6186624K), 0.0569960 secs] [Times: user=0.40 sys=0.00, real=0.05 secs]
      • The above is a minor collection
      • 4310549.766 represents the number of seconds since the jvm is running
      • 856488K->17112K  indicate the combined size of live objects before and after garbage collection, respectively. After minor collections the size includes some objects that are garbage (no longer alive) but that cannot be reclaimed. These objects are either contained in the tenured generation, or referenced from the tenured or permanent generations.
      • (943744K) : The next number in parentheses is the committed size of the heap: the amount of space usable for java objects without requesting more memory from the operating system. Note that this number does not include one of the survivor spaces, since only one can be used at any given time, and also does not include the permanent generation, which holds metadata used by the virtual machine.
      • 0.0557850 secs:  indicates the time taken to perform the collection;
      • For Cassandra, we are using -XX:+UseParNewGC, for which the collections occur about every 8 seconds and take about .026 second (for a minor collection overhead of .23% (refer : )