Commit 846c04b1 authored by Forrest Weston's avatar Forrest Weston Committed by ForrestWeston

Added uuid loggable (requestId) to root context

Every log event resulting from a command will have a uuid associated with it

License: MIT
Signed-off-by: default avatarForrest Weston <forrest@protocol.ai>
parent 115998d2
......@@ -17,6 +17,7 @@ import (
cors "gx/ipfs/QmPG2kW5t27LuHgHnvhUwbHCNHAt2eUcb4gPHqofrESUdB/cors"
logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
loggables "gx/ipfs/QmT4PgCNdv73hnFAqzHqwW44q7M9PWpykSswHDxndquZbc/go-libp2p-loggables"
)
var log = logging.Logger("commands/http")
......@@ -137,6 +138,7 @@ func (i internalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
ctx, cancel := context.WithCancel(node.Context())
ctx = logging.ContextWithLoggable(ctx, loggables.Uuid("requestId"))
defer cancel()
if cn, ok := w.(http.CloseNotifier); ok {
clientGone := cn.CloseNotify()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment