diff --git a/exerr/builder.go b/exerr/builder.go index 96be437..d963353 100644 --- a/exerr/builder.go +++ b/exerr/builder.go @@ -309,27 +309,27 @@ func (b *Builder) Errs(key string, val []error) *Builder { func (b *Builder) GinReq(ctx context.Context, g *gin.Context, req *http.Request) *Builder { if v := ctx.Value("start_timestamp"); v != nil { if t, ok := v.(time.Time); ok { - b.Time("ctx.startTimestamp", t) - b.Time("ctx.endTimestamp", time.Now()) + b.Time("ctx_startTimestamp", t) + b.Time("ctx_endTimestamp", time.Now()) } } - b.Str("gin.method", req.Method) - b.Str("gin.path", g.FullPath()) - b.Strs("gin.header", extractHeader(g.Request.Header)) + b.Str("gin_method", req.Method) + b.Str("gin_path", g.FullPath()) + b.Strs("gin_header", extractHeader(g.Request.Header)) if req.URL != nil { - b.Str("gin.url", req.URL.String()) + b.Str("gin_url", req.URL.String()) } if ctxVal := g.GetString("apiversion"); ctxVal != "" { - b.Str("gin.context.apiversion", ctxVal) + b.Str("gin_context_apiversion", ctxVal) } if ctxVal := g.GetString("uid"); ctxVal != "" { - b.Str("gin.context.uid", ctxVal) + b.Str("gin_context_uid", ctxVal) } if ctxVal := g.GetString("fcmId"); ctxVal != "" { - b.Str("gin.context.fcmid", ctxVal) + b.Str("gin_context_fcmid", ctxVal) } if ctxVal := g.GetString("reqid"); ctxVal != "" { - b.Str("gin.context.reqid", ctxVal) + b.Str("gin_context_reqid", ctxVal) } if req.Method != "GET" && req.Body != nil { @@ -340,12 +340,12 @@ func (b *Builder) GinReq(ctx context.Context, g *gin.Context, req *http.Request) var prettyJSON bytes.Buffer err = json.Indent(&prettyJSON, bin, "", " ") if err == nil { - b.Str("gin.body", string(prettyJSON.Bytes())) + b.Str("gin_body", string(prettyJSON.Bytes())) } else { - b.Bytes("gin.body", bin) + b.Bytes("gin_body", bin) } } else { - b.Str("gin.body", fmt.Sprintf("[[%v bytes | %s]]", len(bin), req.Header.Get("Content-Type"))) + b.Str("gin_body", fmt.Sprintf("[[%v bytes | %s]]", len(bin), req.Header.Get("Content-Type"))) } } } @@ -355,9 +355,9 @@ func (b *Builder) GinReq(ctx context.Context, g *gin.Context, req *http.Request) if brc, ok := req.Body.(dataext.BufferedReadCloser); ok { if bin, err := brc.BufferedAll(); err == nil { if len(bin) < 16*1024 { - b.Bytes("gin.body", bin) + b.Bytes("gin_body", bin) } else { - b.Str("gin.body", fmt.Sprintf("[[%v bytes | %s]]", len(bin), req.Header.Get("Content-Type"))) + b.Str("gin_body", fmt.Sprintf("[[%v bytes | %s]]", len(bin), req.Header.Get("Content-Type"))) } } } diff --git a/goextVersion.go b/goextVersion.go index b81b925..f8e1577 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.443" +const GoextVersion = "0.0.444" -const GoextVersionTimestamp = "2024-05-03T11:56:29+0200" +const GoextVersionTimestamp = "2024-05-03T13:24:08+0200"