controlling log output
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?
Use group_leader for this purpose. Have you checked this link?
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.
精彩评论