From 995a60ea0ba116733583909b25fc63754131e0be Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 23 Dec 2013 15:30:45 -0800 Subject: [PATCH] Setup logging for Raft properly --- consul/server.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/consul/server.go b/consul/server.go index 26fab86fb..d05c0e529 100644 --- a/consul/server.go +++ b/consul/server.go @@ -179,14 +179,14 @@ func (s *Server) setupRaft() error { s.raftStore = store // Create the snapshot store - snapshots, err := raft.NewFileSnapshotStore(path, 3) + snapshots, err := raft.NewFileSnapshotStore(path, 3, s.config.LogOutput) if err != nil { store.Close() return err } // Create a transport layer - trans := raft.NewNetworkTransport(s.raftLayer, 3, 10*time.Second) + trans := raft.NewNetworkTransport(s.raftLayer, 3, 10*time.Second, s.config.LogOutput) s.raftTransport = trans // Setup the peer store @@ -202,6 +202,9 @@ func (s *Server) setupRaft() error { s.raftPeers.SetPeers(raft.AddUniquePeer(peers, trans.LocalAddr())) } + // Make sure we set the LogOutput + s.config.RaftConfig.LogOutput = s.config.LogOutput + // Setup the Raft store s.raft, err = raft.NewRaft(s.config.RaftConfig, s.fsm, store, store, snapshots, s.raftPeers, trans)