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. :)

Comment From: imleon

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

Comment From: yoav-steinberg

Fixed in #6741. Closing.