Reputation: 83
I am working with Datastax enterprise 4.5. I am looking for a setting that stores old system and console logs of cassandra in some history folder when the service is restarted. Is there a setting (where and how to use it) like that?
Upvotes: 2
Views: 402
Reputation: 7305
You can configure log rotation for system.log in log4j.properties
log4j.appender.R.maxFileSize=20MB
log4j.appender.R.maxBackupIndex=50
And output.log in /etc/logrotate.d/cassandra
/var/log/cassandra/output.log {
size 10M
rotate 9
missingok
copytruncate
compress
}
Log files will only grow to the specified size and get a generation number added to the end. I.E. system.log.1, system.log.2
You can schedule the OpsCenter backup service to perform mv / backup for your logs using the before or after scripts. Usually this is used for backing up sstables but there's no reason why it wouldn't work for logs too if you need.
Alternatively, if you want to move / backup the old logs without OpsC, use chron
Upvotes: 2