如何禁用Redis登录Rails日志?

时间:2017-05-01 13:08:33

标签: ruby-on-rails redis

我可以通过set:

禁用Rails中的SQL日志记录
protected void btnDownload(object sender, EventArgs e)
{
    String FileName = title; //from the db
    String FilePath = image_src //source from the db
    System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
    response.ClearContent();
    / response.Clear();
    response.ContentType = "audio/mpeg";
    response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");
    response.TransmitFile(FilePath);
    response.Flush();
    response.End();
}

如何禁用Redis日志记录?

2 个答案:

答案 0 :(得分:0)

请上传Redis配置文件, 应该有一个设置:

# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
# syslog-enabled no

您可以查看' Redis配置文件示例'在http://download.redis.io/redis-stable/redis.conf

配置文件应位于:/etc/redis.conf

答案 1 :(得分:0)

我在config/initializers/redis.rb更改中找到了它:

#REDIS.client.logger = Rails.logger
REDIS.client.logger = nil