Something misleading in redis.conf #371

shaofengniu opened this Issue Mar 5, 2012 · 1 comment


None yet

2 participants


What I want to do is put data and log files into different directories. So I put dir ./data and logfile log/redis.log into the redis.conf.
Then something weird happened. There're two redis.log file generated: ./redis.log and data/redis.log. And the first one is empty.
I checked the config code in config.c and saw that the dir configuration is implemented by a chdir command. That explains what happend. Since the dir is several lines below logfile in redis.conf, redis will first create ./redis.log and then change dir to ./data and the logfile is created again in this directory.
Result is there are two log files and the one in my expected place is an empty one.

So I change the dir option to dir ./ and put it to the first line of redis.conf and set the dbfilename and appendonlyfilename to data/filename. Problem solved.

What I suggest is the configurations shouldn't be related with their order. :)

imleon commented Mar 28, 2012

I've got the same problem. Two redis.log were created and the first is empty.
Please fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment