special logging fields: from now on only 'job', 'task', 'subsystem'

This commit is contained in:
Christian Schwarz
2018-08-25 22:15:37 +02:00
parent e30ae972f4
commit 861e5f8313
5 changed files with 13 additions and 30 deletions
+2 -2
View File
@@ -209,8 +209,8 @@ func (j *SourceJob) handleConnection(conn net.Conn, task *Task) {
senderEP := endpoint.NewSender(j.Filesystems, NewPrefixFilter(j.SnapshotPrefix))
ctx := context.Background()
ctx = context.WithValue(ctx, contextKeyLog, task.Log().WithField("subsystem", "rpc.endpoint"))
ctx = streamrpc.ContextWithLogger(ctx, streamrpcLogAdaptor{task.Log().WithField("subsystem", "rpc.protocol")})
ctx = context.WithValue(ctx, contextKeyLog, task.Log().WithField(logSubsysField, "rpc.endpoint"))
ctx = streamrpc.ContextWithLogger(ctx, streamrpcLogAdaptor{task.Log().WithField(logSubsysField, "rpc.protocol")})
handler := endpoint.NewHandler(senderEP)
if err := streamrpc.ServeConn(ctx, conn, STREAMRPC_CONFIG, handler.Handle); err != nil {
task.Log().WithError(err).Error("error serving connection")