HttpClient log

Update time: 2019-06-21

HttpClient Log Format

After integrating tracer-httpclient-plugin, SOFATracer outputs the link data requested by HttpClient in JSON data by default.

HttpClient digest log (httpclient-digest.log)

The data is output in JSON format. Each key meaning is as follows:

Key Meaning
Time log printing time Current application name
traceId TraceId
spanId SpanId
Request.url Request URL
Method Request HTTP method
Result.code HTTP call returns status code
req.size.bytes Request body size
resp.size.bytes Response body size
Time.cost.milliseconds Request time (ms) Thread name Name of the called application
Baggage Transparently transmitted baggage data


{"time":"2018-09-27 21:58:43.067","":"HttpClientDemo","traceId":"0a0fe8801538056723034100235072","spanId":"0","request.url":"http://localhost:8080/httpclient","method":"GET","result.code":"200","req.size.bytes":0,"resp.size.bytes":-1,"time.cost.milliseconds":33,"":"I/O dispatcher 1","":"","baggage":""}

Note: The application name can be passed in as a parameter when constructing an HttpClient instance via SofaTracerHttpClientBuilder.

HttpClient statistical Log (httpclient-stat.log)

stat.key is the collection of statistical keywords in this period, which uniquely determines a set of statistical data, including, request.url, and method field.

Key Meaning
time Log printing time
stat.key Current application name
request.url Request URL
method Request HTTP method
count Number of requests in this period
total.cost.milliseconds Total duration (ms) for requests in this period
success Request result: Y means success (the result code starting with 1 and 2 indicates success, and 302 indicates that the redirection is successful, and others indicate failure); N indicates failure
load.test Pressure test mark: T indicates pressure test; F indicates non-pressure test


{"time":"2018-09-27 21:59:42.233","stat.key":{"request.url":"http://localhost:8080/httpclient","":"HttpClientDemo","method":"GET"},"count":2,"total.cost.milliseconds":562,"success":"true","load.test":"F"}