In redis
, the data is stored in one log file and it keeps getting bigger and bigger. Its size has increased to few GB. How can I store the log file as several files instead of one sorted by date?
Asked
Active
Viewed 777 times
1

prolificslacker
- 1,275

Manoj
- 11
1 Answers
2
You can use logrotate
:
Create a file /etc/logrotate.d/redis
with something like this:
/var/log/redis/redis-server.log {
daily
rotate 12
compress
delaycompress
missingok
notifempty
create 644 root root
}
More configuration can be found here
EDIT: If you want a dd-mm-yy
format you can use the dateformat
directive as explain in this response.

jmlemetayer
- 156
- 7
Redis to log on the standard output. Note that if you use standard
output for logging but daemonize, logs will be sent to /dev/null
logfile "/path/to/redis.log"
– Manoj Jun 14 '17 at 10:14