有没有通过redis-cli设置日志文件而不编辑redis.config文件的方法?

huangapple go评论61阅读模式
英文:

Is there any way for setting the logfile via redis-cli but not editing the redis.config file?

问题

我尝试通过设置一个日志文件来修改运行中的Redis配置。由于Redis正在生产环境中运行,我无法编辑redis.config文件。我使用脚本更改了dbfilename参数。

英文:

I am trying to modify the running redis configuration by setting a logfile in it. I cannot edit the redis.config file as the redis is running on production. I changed the dbfilename parameter using the script.

答案1

得分: 3

你不能使用 CONFIG SET 来更改 logfile。你可以更改其他配置设置,包括 loglevel,但是不能更改 logfile,因为目前不支持。

你可以使用 CONFIG GET logfile 来查看当前的设置值。如果为空,它将输出到标准输出或终端。

有点巧妙,但你可以使用 gdb重定向输出

英文:

You cannot change the logfile using CONFIG SET. You can change other config settings, including loglevel, but not logfile as it is currently unsupported.

You can use CONFIG GET logfile to see the current setting value. If empty, it is going to standard output or a TTY.

A little hackish, but you can redirect the output using gdb.

huangapple
  • 本文由 发表于 2020年1月6日 16:03:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/59608575.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定