禁用Rails日志以记录ActionCable事件 [英] Disable rails log for ActionCable events

查看:80
本文介绍了禁用Rails日志以记录ActionCable事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

development环境中,Rails记录器记录了有时很烦人的所有ActionCable事件(对于我的项目,它时不时地传输消息,并且日志尾部像野马一样运行).什么是抑制来自ActionCable的所有事件日志的有效方法?另外,如何抑制某些特定的ActionCable事件?

In development environment, rails logger logs all ActionCable events which is sometimes annoying (for my project, every now and then it's transmitting messages and log tail is running like wild horse). What is an efficient way to suppress all event logs from ActionCable? Also, how can I suppress some specific ActionCable events?

推荐答案

要完全禁用来自ActionCable的日志记录,您应该将ActionCable配置为使用不执行任何操作的记录器

To completely disable logging from ActionCable you should configure ActionCable to use logger that do nothing

ActionCable.server.config.logger = Logger.new(nil)

这篇关于禁用Rails日志以记录ActionCable事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆