[lxc-devel] [lxd/master] Pass a logger to raft-http
freeekanayaka on Github
lxc-bot at linuxcontainers.org
Sat Apr 14 18:37:42 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 650 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180414/27df8f31/attachment.bin>
-------------- next part --------------
From c1337c729314be37c9b5f4bff86e88ae199e6474 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Sat, 14 Apr 2018 14:29:00 +0000
Subject: [PATCH] Pass a logger to raft-http
This will use the raftLogger wrapper that we already have, and forward to our
logger. The output will be just a few INFO messages when connecting between
nodes, joining and leaving, so pretty low noise.
Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
lxd/cluster/raft.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lxd/cluster/raft.go b/lxd/cluster/raft.go
index 97483553f..72ce4c437 100644
--- a/lxd/cluster/raft.go
+++ b/lxd/cluster/raft.go
@@ -308,7 +308,7 @@ func raftNetworkTransport(
logger *log.Logger,
timeout time.Duration,
dial rafthttp.Dial) (raft.Transport, *rafthttp.Handler, *rafthttp.Layer, error) {
- handler := rafthttp.NewHandler()
+ handler := rafthttp.NewHandlerWithLogger(logger)
addr, err := net.ResolveTCPAddr("tcp", address)
if err != nil {
return nil, nil, nil, errors.Wrap(err, "invalid node address")
More information about the lxc-devel
mailing list