Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HTTPListener = &crest.HTTPListener{ Callback: func(response crest.RequestResponse) { id := uuid.NewString() ctx := context.TODO() if response.Request != nil && response.Request.Context() != nil { ctx = response.Request.Context() } if response.Request != nil { if response.Request.URL != nil { if response.Request.Body != nil { body, _ := io.ReadAll(response.Request.Body) rest.Logger.Printf(ctx, "[%s] %s %s", id, response.Request.Method, response.Request.URL.String()) rest.Logger.Printf(ctx, "[%s] [PAYLOAD] %s", id, string(body)) } else { rest.Logger.Printf(ctx, "[%s] %s %s", id, response.Request.Method, response.Request.URL.String()) } } } if response.Response != nil { if response.Response.Body != nil { if os.Getenv("DYNATRACE_HTTP_RESPONSE") == "true" { body, _ := io.ReadAll(response.Response.Body) if body != nil { rest.Logger.Printf(ctx, "[%s] [RESPONSE] %d %s", id, response.Response.StatusCode, string(body)) } else { rest.Logger.Printf(ctx, "[%s] [RESPONSE] %d", id, response.Response.StatusCode) } } } } }, }
Functions ¶
func InstallRoundTripper ¶ added in v1.70.0
func InstallRoundTripper()
Types ¶
type RoundTripper ¶
type RoundTripper struct { RoundTripper http.RoundTripper // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.