控制日志输出
如果您将一个节点作为从属节点启动,则其所有日志输出都会发送到主节点。然而,在我的设置中,我并不希望一定有一个主节点,我有可以自动发现并随意加入集群的节点。不过,我仍然希望将集群的所有日志输出发送到单个节点。有没有一种方法可以动态地使节点的日志记录行为就像它作为从属启动一样?否则,我是否需要更改每个已安装的 error_handler 以将输出重定向到我想要的位置?
这是我的理想设置:我翻转一个开关,集群中的所有节点都会将所有内容发送到任何节点的 tty--io:format 调用或 sasl 报告或其他内容,而不是发送到它所在的一个节点两者都显示在 tty 上并登录到循环文件中。什么会使这成为现实?
If you start up a node as a slave, all its log output goes to the master. However, in my setup, I don't want to necessarily have a master, and I have nodes that automatically discover and join the cluster at will. I'd still like to have all the cluster's log output go to a single node, though. Is there a way to dynamically make a node's logging behave as if it were started as a slave? Otherwise, do I need to alter each installed error_handler to redirect output to where I want it to go?
Here would be my ideal setup: I flip a switch and all nodes in the cluster send everything that's going to any of the nodes' tty--io:format calls or sasl reports or what have you-- instead to one node where it is both displayed on the tty and logged in round robin files. What would make this a reality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为此目的使用 group_leader 。您检查过这个链接?
Use group_leader for this purpose. Have you checked this link?
我认为 http://jkvor.com/log-roller 可能是答案,尽管它不会捕获 io:format 调用,我不认为。但是,如果您将日志函数调用限制在 error_logger 模块中,那么它应该可以很好地工作。
I think http://jkvor.com/log-roller may be the answer, although it wouldn't capture io:format calls, I don't think. However, if you confine your log function calls to the error_logger module, it should work great.