diff --git a/internal/nodes/http_request_log.go b/internal/nodes/http_request_log.go index cd7430f..927f872 100644 --- a/internal/nodes/http_request_log.go +++ b/internal/nodes/http_request_log.go @@ -3,10 +3,14 @@ package nodes import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" + "strconv" "strings" + "sync/atomic" "time" ) +var requestId int64 = 1_0000_0000_0000_0000 + // 日志 func (this *HTTPRequest) log() { // 计算请求时间 @@ -73,6 +77,7 @@ func (this *HTTPRequest) log() { } accessLog := &pb.HTTPAccessLog{ + RequestId: strconv.FormatInt(this.requestFromTime.UnixNano(), 10) + strconv.FormatInt(atomic.AddInt64(&requestId, 1), 10) + sharedNodeConfig.PaddedId(), NodeId: sharedNodeConfig.Id, ServerId: this.Server.Id, RemoteAddr: this.requestRemoteAddr(),