RestTemplate log

Update time: 2019-06-21

RestTemplate Log Format

SOFATracer integrates RestTemplate and outputs the requested link log data format. The default is JSON data format.

RestTemplate digest log(resttemplate-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 return status code
resp.size.bytes Response Body Size
time.cost.milliseconds Request time (ms) Current thread name remote app name
baggage Transparently transmitted baggage data


{"time":"2018-10-24 10:45:28.977","":"RestTemplateDemo","traceId":"0a0fe8b3154034912878910015081","spanId":"0","request.url":"","method":"GET","result.code":"200","resp.size.bytes":0,"time.cost.milliseconds":188,"":"main","":"","baggage":""}

RestTemplate stat log(resttemplate-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 ; N indicates failure
load.test Pressure test mark: T indicates pressure test; F indicates non-pressure test


{"time":"2018-10-24 10:46:28.769","stat.key":{"method":"GET","":"RestTemplateDemo","request.url":""},"count":1,"total.cost.milliseconds":5009,"success":"true","load.test":"F"}