Dady09
Dady09

Reputation: 659

Cassandra does not log anywhere

I start working on an old version of cassandra (1.1) that uses log4j, the problem is 'there is no logs anywhere' after some investigations i found two files from which we can change the log setting :

1/ The log4j-server.properties, settings ares supposed to plug in syslog (but it does not work)

log4j.rootLogger=WARN,SYSLOG

log4j.logger.org.apache.thrift.server.TNonblockingServer=ERROR
log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender
log4j.appender.SYSLOG.SyslogHost=localhost
log4j.appender.SYSLOG.Facility=Local0
log4j.appender.SYSLOG.FacilityPrinting=false
log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout
log4j.appender.SYSLOG.layout.ConversionPattern=%m
log4j.appender.SYSLOG.header = true

2/ The /etc/default/cassandra file which contains the $CASSANDRA_LOG_DIR (

CASSANDRA_LOG_DIR=/$USER/logs/cassandra

I have the same settings on all the servers (the syslog one with log4j and the default log file ) however cassandra can log only on some servers using the defaut file (/$USER/logs/cassandra/output.log)

My question is : which setting cassandra uses by default ? and can we make cassandra write logs even without log4j ?

Upvotes: 0

Views: 11410

Answers (1)

mbeacom
mbeacom

Reputation: 1520

By default, the Cassandra output.log is located at: /var/log/cassandra/output.log

The output.log captures the stdout of the Cassandra process.

If you're attempting to change the configuration for full diagnostics, you'll want to manipulate the log4j-server.properties file per the information at documenation provided by DataStax.

Check the "Changing Log Levels" section from the above link.

By default, the system.log file (the log file that log4j is writing to) is located at /var/log/cassandra/system.log

Referencing DataStax Documentation:

By default, logging output is placed the /var/log/cassandra/system.log. You can change the location of the output by editing the log4j.appender.R.File path. Be sure that the directory exists and is writable by the process running Cassandra.

You can find the full documentation for changing the log rotation for the cassandra system.log file here.

Please note that the above explanation is for Cassandra <= 2.0 If you're looking for information on logging configuration for Cassandra >= 2.1, you'll want to check out this documentation page by DataStax, as 2.1+ uses logback instead of log4j. Thank you, phact for the note!

Upvotes: 5

Related Questions