It would be nice if redis logging (/var/log/redis/redis.log) would support reopening a log file upon SIGUSR1 or SIGUSR2 or some other signal.
I find nginx a good example for how to deal with this:
-s signal Send signal to the master process. The argument signal can be one of: stop, quit, reopen, reload. The following table shows the
corresponding system signals.
Redis always reopens the log, after every single message, so there is no need for this I guess.
About reloading the configuration, we deal with this using CONFIG GET/SET. But my plan is to also add a CONFIG REWRITE that will flush the changes in the redis.conf file.
Ah, I didn't know that and couldn't figure it out myself it appears. That's obviously good enough, except it might be more obvious. wink
Indeed that should be documented in some please... taking note, thanks.
Block all signals on blocker_pool worker threads.
Redis 2.2.8 does not reopen the log file after each entry. Yes, I know we should upgrade, and we're planning on that.
Is a restart the only way to achieve this in 2.2.8?
The log file is opened with each new log line written: https://github.com/antirez/redis/blob/ec279203df0bc6ddc981394d7d61bceff884e681/src/redis.c#L207
Newer versions cover more edge cases for the log file not re-opening on some writes from signal handlers.
Can't provide any further help on something that old.