Log descriptions

更新时间:
复制 MD 格式

SOFATracer supports open source components such as Spring MVC, database connection pools that implement the standard Java Database Connectivity (JDBC) interface (DBCP, Druid, c3p0, tomcat, HikariCP, and BoneCP), HttpClient, Dubbo, and Spring Cloud OpenFeign. After you enable instrumentation for these components, you can view the corresponding Tracer logs. This topic describes several types of logs and their formats.

Note
  • Logs for the open source edition are in JSON format by default. Logs for the Enterprise Edition are comma-separated by default.

  • New fields may be added to the logs periodically. These new fields are appended to the end of the log and do not affect existing log fields. If the number of fields in your actual logs differs from what is described in this topic, compare them in order. For information about new fields, contact technical support.

Spring MVC logs

After SOFATracer is integrated with Spring MVC, it outputs trace data for MVC requests. The default data format is JSON.

Spring MVC summary log

The spring-mvc-digest.log file is the Spring MVC summary log, which is output in JSON format. The following is a sample log:

{"time":"2019-09-03 10:33:10.336","local.app":"RestTemplateDemo","traceId":"0a0fe9271567477985327100211176","spanId":"0.1","span.kind":"server","result.code":"200","current.thread.name":"http-nio-8801-exec-2","time.cost.milliseconds":"5006ms","request.url":"http://localhost:8801/asyncrest","method":"GET","req.size.bytes":-1,"resp.size.bytes":0,"sys.baggage":"","biz.baggage":""}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

The TraceId of the request.

For more information, see TraceId generation rules.

spanId

The SpanId of the request.

For more information, see SpanId generation rules.

span.kind

The Span type.

result.code

The result code.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The duration of the Span in milliseconds (ms).

request.url

The request URL.

method

The invoked method.

req.size.bytes

The size of the request data in bytes.

resp.size.bytes

The size of the response data in bytes.

sys.baggage

System pass-through baggage data.

biz.baggage

Business pass-through baggage data.

Spring MVC statistics log

The spring-mvc-stat.log file is the Spring MVC statistics log. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the method, local.app, and request.url fields. The following is a sample log:

{"time":"2019-09-03 10:34:04.129","stat.key":{"method":"GET","local.app":"RestTemplateDemo","request.url":"http://localhost:8801/asyncrest"},"count":1,"total.cost.milliseconds":5006,"success":"true","load.test":"F"}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

stat.key

method

Method invocation

local.app

The name of the current application.

request.url

The request URL.

count

The number of requests.

total.cost.milliseconds

The total request duration in milliseconds (ms).

success

The request result:

  • true: The request was successful.

    Status codes 1XX, 2XX, 301, and 302 indicate success. Other status codes indicate failure.

  • false: The request failed.

load.test

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

HttpClient logs

After SOFATracer is integrated with the sofa-tracer-httpclient-plugin, it outputs trace data for HttpClient requests. The default data format is JSON.

HttpClient summary log

The httpclient-digest.log file is the HttpClient summary log, which is output in JSON format. The following is a sample log:

{"time":"2019-09-02 23:43:13.191","local.app":"HttpClientDemo","traceId":"1e27a79c1567438993170100210107","spanId":"0","span.kind":"client","result.code":"200","current.thread.name":"I/O dispatcher 1","time.cost.milliseconds":"21ms","request.url":"http://localhost:8080/httpclient","method":"GET","req.size.bytes":0,"resp.size.bytes":-1,"remote.app":"","sys.baggage":"","biz.baggage":""}

The following describes the keys:

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

Trace ID

spanId

Span ID

span.kind

The Span type.

result.code

The result code.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The duration of the Span.

request.url

The request URL.

method

The invoked method.

req.size.bytes

The size of the request data.

resp.size.bytes

The size of the response data.

remote.app

The name of the destination application.

sys.baggage

System pass-through baggage data.

biz.baggage

Business pass-through baggage data.

Note

Pass the application name as an input parameter when you construct an HttpClient instance using SofaTracerHttpClientBuilder.

HttpClient statistics log

The httpclient-stat.log file is the HttpClient statistics log. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the method, local.app, and request.url fields. The following is a sample log:

{"time":"2019-09-02 23:44:11.785","stat.key":{"method":"GET","local.app":"HttpClientDemo","request.url":"http://localhost:8080/httpclient"},"count":2,"total.cost.milliseconds":229,"success":"true","load.test":"F"}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

stat.key

method

The invoked method.

local.app

The name of the current application.

request.url

The request URL.

count

The number of requests.

total.cost.milliseconds

The total request duration.

success

The request result:

  • true: The request was successful.

  • false: The request failed.

load.test

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

DataSource logs

SOFATracer provides instrumentation for standard JDBC data sources to output trace data for SQL statement executions. The default log output format is JSON.

DataSource summary log

The datasource-client-digest.log file is the DataSource summary log. The data is output in JSON format. The following is a sample log:

2019-09-02 21:31:31.566, SOFATracerDataSource,, 0a0fe91d156743109138810017302,0.1, client, 00, http-nio-8080-exec-1,15ms, test, CREATE TABLE TEST(ID INT PRIMARY KEY%2C NAME VARCHAR(255)), 128ms, 15ms, h2, jdbc:h2:~/test:-1","sys.baggage,,

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

Trace ID

spanId

SpanId

span.kind

The Span type.

result.code

The result code. Valid values:

  • 00: The request was successful.

  • 03: The request timed out.

  • 99: The request failed.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The duration of the Span.

database.name

The name of the database.

SQL

The executed SQL statement.

connection.establish.span

The time taken to establish the SQL connection.

db.execute.cost

The SQL execution duration.

database.type

The database type.

database.endpoint

The database URL.

sys.baggage

System pass-through baggage data, displayed in key-value (KV) format.

biz.baggage

Business pass-through baggage data, displayed in KV format.

DataSource statistics log

The datasource-client-stat.log file is the DataSource statistics log. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the local.app, database.name, and SQL fields. The following is a sample log:

{"time":"2019-09-02 21:31:50.435","stat.key":{"local.app":"SOFATracerDataSource","database.name":"test","SQL":"DROP TABLE IF EXISTS TEST;
CREATE TABLE TEST(ID INT PRIMARY KEY%2C NAME VARCHAR(255));"},"count":1,"total.cost.milliseconds":15,"success":"true","load.test":"F"}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

stat.key

local.app

The name of the current application.

database.name

The name of the database.

SQL

The executed SQL statement.

count

The number of SQL executions.

total.cost.milliseconds

The total SQL execution duration in milliseconds (ms).

success

The request result:

  • true: The request was successful.

  • false: The request failed.

load.test

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

SOFARPC logs

After SOFATracer is integrated with SOFARPC (version 5.4.0 and later), it outputs trace data. The default data format is JSON.

RPC client summary log

The rpc-client-digest.log file is the RPC client summary log. The following is a sample log:

2021-09-27 16:43:59.096,myserver-app,1ecee1741632732******410896596,0,com.alipay.samples.rpc.SampleService:1.0,hello,bolt,,127.0.0.1,myclient-app,,,1ms,0ms,SOFA-SEV-BOLT-BIZ-12201-9-T20,00,,,0ms,,

The following table describes the keys.

Key

Description

timestamp

The time when the log was recorded.

local.app

The name of the current application.

traceId

Trace ID

spanId

Span ID

service

The service interface information.

method

The invoked method.

span.kind

The Span type.

protocol

The protocol type. Valid values: bolt and rest.

invoke.type

The call type. Valid values:

  • sync: A synchronous call. This is the default call type for Bolt.

  • oneway: An asynchronous invocation. The consumer returns immediately after sending the request, ignoring the provider's processing result.

  • callback: An asynchronous invocation. The consumer provides a callback interface. When the provider returns a response, the SOFA framework executes the callback interface.

  • future: An asynchronous invocation. The consumer returns immediately after initiating the call. When the result is needed, the consumer must actively retrieve the data.

remote.ip

The destination IP address.

remote.app

The name of the destination application.

remote.zone

Destination zone

remote.idc

The destination IDC.

remote.city

The destination city.

user.id

The user ID.

result.code

The result code. Valid values:

  • 00: The request was successful.

  • 01: A business exception occurred.

  • 02: An RPC logic error occurred.

  • 03: The request timed out.

  • 04: Routing failed.

req.size

The size of the request data.

resp.size

The size of the response data.

client.elapse.time

The total call duration in milliseconds (ms).

client.conn.time

The client connection duration in milliseconds (ms).

req.serialize.time

The request serialization duration in milliseconds (ms).

outtime

The reference duration for a timeout in milliseconds (ms).

current.thread.name

The name of the current thread.

route.record

The routing record. This records the route selection process.

elastic.id

The elastic data bit.

be.elastic

Indicates whether the service for this call requires elasticity:

  • T: Elasticity is required.

  • F: Not required.

elastic.service.name

The name of the forwarded method.

local.client.ip

The source IP address.

local.client.port

The local client port.

local.zone

The local zone.

target.ip.in.one.physical

Indicates whether the destination IP address is on the current physical machine:

  • T: On the same physical machine.

  • F: Not on the same physical machine.

sys.baggage

System pass-through baggage data.

bus.baggage

Business pass-through baggage data.

send.time

The RPC request duration. This is a reserved field and is not yet enabled.

phase.time

The duration of each phase in milliseconds (ms).

special.time.mark

A special timestamp marker.

router.forward

Details of the routing forward. This is a reserved field and is not yet enabled.

RPC server-side summary log

The rpc-server-digest.log file is the RPC server-side summary log. The following is a sample log:

2014-06-19 17:14:35.006,client,0ad1348f140****2750021003,0.1,com.alipay.cloudenginetest.services.SofaApiWebReferenceLocalFalseTrService:1.0,service_method,TR,,10.**.**.143,client,,,12ms,0ms,HSFBizProcessor-4-thread-2,00,,F,1000ms,zue:l;ztg:r,mark=T&uid=a2&

The keys are described as follows:

Key

Description

timestamp

The time when the log was recorded.

local.app

The name of the current application.

traceId

TraceId

spanId

SpanId

service

The service interface information.

method

The invoked method.

protocol

The protocol type. Valid values: bolt and rest.

remote.ip

The destination IP address.

remote.app

The name of the destination application.

invoke.type

The call type. Valid values:

  • sync: A synchronous call. This is the default call type for Bolt.

  • oneway: An asynchronous invocation. The consumer returns immediately after sending the request, ignoring the provider's processing result.

  • callback: An asynchronous invocation. The consumer provides a callback interface. When the provider returns a response, the SOFA framework executes the callback interface.

  • future: An asynchronous invocation. The consumer returns immediately after initiating the call. When the result is needed, the consumer must actively retrieve the data.

remote.ip

The caller IP address.

remote.app

The name of the caller application.

remote.zone

The caller zone.

remote.idc

The caller IDC.

biz.impl.time

The request processing duration in milliseconds (ms).

This does not include the server-side response serialization and deserialization duration.

resp.serialize.time

The response serialization duration in milliseconds (ms).

current.thread.name

The name of the current thread.

result.code

The return code. Valid values:

  • 00: The request was successful.

  • 01: A business exception occurred.

  • 02: An RPC logic error occurred.

elastic.service.name

Indicates that the current call is a forwarded call. It includes the name and method value of the forwarded service.

be.elasticc

Indicates whether this service was forwarded:

  • T: Forwarded.

  • F: The service was not forwarded.

server.pool.wait.time

The server-side thread pool wait time in milliseconds (ms).

sys.baggage

System pass-through baggage data.

bus.baggage

Business pass-through baggage data.

server.send.time

The RPC request forwarding duration. This is a reserved field and is not yet enabled.

req.size

The size of the request data.

resp.size

The size of the response data.

phase.time

The duration details of each phase.

special.time

A special timestamp marker.

router.forward

Details of the routing forward. This is a reserved field and is not yet enabled.

RPC client statistics log

The rpc-client-stat.log file is the RPC client statistics log. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the local.app, remote.app, service.name, and method.name fields. The following is a sample log:

2014-06-19 17:14:02.186,client,client,com.alipay.cloudenginetest.services.SofaApiWebReferenceLocalFalseTrService:1.0,service_method,1,79,Y,T,RZ00B

The following describes the keys:

Key

Description

time

The time when the log was recorded.

stat.key

local.app

The name of the current application.

remote.app

The name of the destination application.

service.name

The service name.

method.name

The method name.

count

The number of calls.

total.cost.milliseconds

The total request duration.

success

The call result:

  • Y: The call was successful.

  • N: The call failed.

load.test.mark

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

remote.zone

Target Zone

RPC server-side statistics log

The rpc-server-stat.log file is the RPC server-side statistics log. The data is output in JSON format. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the local.app, remote.app, service.name, and method.name fields. The following is a sample log:

2014-06-19 17:14:02.186,client,client,com.alipay.cloudenginetest.services.SofaApiWebReferenceLocalFalseTrService:1.0,service_method,1,7,Y,T,GZ00B

The following describes the keys:

Key

Description

time

The time when the log was recorded.

stat.key

local.app

The name of the current application.

remote.app

The name of the destination application.

service.name

The service name.

method

The method name.

count

The number of calls.

total.cost.milliseconds

The total request duration.

success

The call result:

  • Y: The call was successful.

  • N: The call failed.

load.test.mark

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

remote.zone

The destination zone.

OkHttp logs

After SOFATracer is integrated with OkHttp, it outputs trace data for requests. The default data format is JSON.

OkHttp summary log

The okhttp-digest.log file is the OkHttp summary log, which is output in JSON format. The following is a sample log:

{"time":"2021-07-19 14:27:25.076","local.app":"web-demo","traceId":"1e1ebd021626676044097100153807","spanId":"0.1","span.kind":"client","result.code":"200","current.thread.name":"SOFA-SEV-REST-BIZ-8341-9-T2","time.cost.milliseconds":"267ms","request.url":"http://localhost:8341/sofarest/hello","method":"GET","result.code":"200","req.size.bytes":0,"resp.size.bytes":0,"remote.app":"","sys.baggage":"","biz.baggage":""}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

The TraceId.

spanId

Span ID

span.kind

The Span type.

result.code

The result code.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The request duration.

request.url

The request URL.

method

Invoke the method

req.size.bytes

The size of the request data.

resp.size.bytes

The size of the response data.

remote.app

The destination application.

sys.baggage

System pass-through baggage data.

biz.baggage

Business pass-through baggage data.

OkHttp statistics log

The okhttp-stat.log file is the OkHttp statistics log. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the method, local.app, and request.url fields. The following is a sample log:

{"time":"2019-09-03 11:43:06.975","stat.key":{"method":"GET","local.app":"OkHttpDemo","request.url":"http://localhost:8081/okhttp?name=sofa"},"count":1,"total.cost.milliseconds":174,"success":"true","load.test":"F"}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

stat.key

method

Method invocation

local.app

The name of the current application.

request.url

The request URL.

count

The number of requests.

total.cost.milliseconds

The total request duration.

success

The request result:

  • true: The request was successful.

  • false: The request failed.

load.test

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

RestTemplate logs

After SOFATracer is integrated with RestTemplate, it outputs trace data for requests. The default data format is JSON.

RestTemplate summary log

The resttemplate-digest.log file is the RestTemplate summary log, which is output in JSON format. The following is a sample log:

{"time":"2019-09-03 10:33:10.336","local.app":"RestTemplateDemo","traceId":"0a0fe9271567477985327100211176","spanId":"0","span.kind":"client","result.code":"200","current.thread.name":"SimpleAsyncTaskExecutor-1","time.cost.milliseconds":"5009ms","request.url":"http://localhost:8801/asyncrest","method":"GET","req.size.bytes":0,"resp.size.bytes":0,"sys.baggage":"","biz.baggage":""}

The following describes the keys:

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

Trace ID

spanId

Span ID

span.kind

The Span type.

result.code

The result code.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The duration of the Span.

request.url

The request URL.

method

Invocation method

req.size.bytes

The size of the request data.

resp.size.bytes

The size of the response data.

sys.baggage

System pass-through baggage data.

biz.baggage

Business pass-through baggage data.

RestTemplate statistics log

The resttemplate-stat.log file is the RestTemplate statistics log. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the method, local.app, and request.url fields. The following is a sample log:

{"time":"2019-09-03 10:34:04.130","stat.key":{"method":"GET","local.app":"RestTemplateDemo","request.url":"http://localhost:8801/asyncrest"},"count":1,"total.cost.milliseconds":5009,"success":"true","load.test":"F"}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

stat.key

method

Method invocation

local.app

The name of the current application.

request.url

The request URL.

count

The number of requests.

total.cost.milliseconds

The total request duration.

success

The request result:

  • true: The request was successful.

  • false: The request failed.

load.test

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

Dubbo logs

After SOFATracer is integrated with Dubbo, it outputs trace data for requests. The default data format is JSON.

Dubbo service consumer summary log

The dubbo-client-digest.log file is the Dubbo service consumer summary log, which is output in JSON format. The following is a sample log:

{"time":"2019-09-02 23:36:08.250","local.app":"dubbo-consumer","traceId":"1e27a79c156743856804410019644","spanId":"0","span.kind":"client","result.code":"00","current.thread.name":"http-nio-8080-exec-2","time.cost.milliseconds":"205ms","protocol":"dubbo","service":"com.glmapper.bridge.boot.service.HelloService","method":"SayHello","invoke.type":"sync","remote.host":"192.168.2.103","remote.port":"20880","local.host":"192.168.2.103","client.serialize.time":35,"client.deserialize.time":5,"req.size.bytes":336,"resp.size.bytes":48,"error":"","sys.baggage":"","biz.baggage":""}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

Trace ID

spanId

Span ID

span.kind

The Span type.

result.code

The result code. Valid values:

  • 00: The request was successful.

  • 03: The request timed out.

  • 99: The request failed.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The duration of the Span.

protocol

The protocol type.

service

The service interface.

method

Invoking a method

invoke.type

The call type. Valid values:

  • sync: A synchronous call. This is the default call type for Bolt.

  • oneway: An asynchronous invocation. The consumer returns immediately after sending the request, ignoring the provider's processing result.

  • callback: An asynchronous invocation. The consumer provides a callback interface. When the provider returns a response, the SOFA framework executes the callback interface.

  • future: An asynchronous invocation. The consumer returns immediately after initiating the call. When the result is needed, the consumer must actively retrieve the data.

remote.host

The destination host IP address.

remote.port

The destination port.

local.host

The local host IP address.

client.serialize.time

The request serialization time.

client.deserialize.time

The response deserialization time.

req.size.bytes

The size of the request data.

resp.size.bytes

The size of the response data.

error

The error message.

sys.baggage

System pass-through baggage data.

biz.baggage

Business pass-through baggage data.

Dubbo service provider summary log

The dubbo-server-digest.log file is the Dubbo service provider summary log, which is output in JSON format. The following is a sample log:

{"time":"2019-09-02 23:36:08.219","local.app":"dubbo-provider","traceId":"1e27a79c156743856804410019644","spanId":"0","span.kind":"server","result.code":"00","current.thread.name":"DubboServerHandler-192.168.2.103:20880-thread-2","time.cost.milliseconds":"9ms","protocol":"dubbo","service":"com.glmapper.bridge.boot.service.HelloService","method":"SayHello","local.host":"192.168.2.103","local.port":"62443","server.serialize.time":0,"server.deserialize.time":27,"req.size.bytes":336,"resp.size.bytes":0,"error":"","sys.baggage":"","biz.baggage":""}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

Trace ID

spanId

Span ID

span.kind

The Span type.

result.code

The result code. Valid values:

  • 00: The request was successful.

  • 03: The request timed out.

  • 99: The request failed.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The duration of the Span.

protocol

The protocol type.

service

The service interface.

method

The invoked method.

invoke.type

The call type.

local.host

The local host IP address.

local.port

The local port.

server.serialize.time

The response serialization time in milliseconds (ms).

server.deserialize.time

The request deserialization time in milliseconds (ms).

req.size.bytes

The size of the request data in bytes.

resp.size.bytes

The size of the response data in bytes.

error

The error message.

sys.baggage

System pass-through baggage data.

biz.baggage

Business pass-through baggage data.

Dubbo statistics log

The dubbo-client-stat.log and dubbo-server-stat.log files are the Dubbo statistics logs. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the local.app, service, and method fields. The following is a sample log:

{"time":"2019-09-02 23:36:13.040","stat.key":{"method":"SayHello","local.app":"dubbo-consumer","service":"com.glmapper.bridge.boot.service.HelloService"},"count":1,"total.cost.milliseconds":205,"success":"true","load.test":"F"}

The following table describes the keys.

Key

Description

time

The time when the log was recorded.

stat.key

method

The invoked method.

local.app

The name of the current application.

service

The service name.

count

The number of requests.

total.cost.milliseconds

The total request duration.

success

The request result:

  • true: The request was successful.

  • false: The request failed.

load.test

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

Spring Cloud OpenFeign logs

After SOFATracer is integrated with Spring Cloud OpenFeign, it outputs trace data for requests. The default data format is JSON.

Spring Cloud OpenFeign summary log

The feign-digest.log file is the Spring Cloud OpenFeign summary log, which is output in JSON format. The following is a sample log:

{"time":"2019-09-03 10:28:52.363","local.app":"tracer-consumer","traceId":"0a0fe9271567477731347100110969","spanId":"0.1","span.kind":"client","result.code":"200","current.thread.name":"http-nio-8082-exec-1","time.cost.milliseconds":"219ms","request.url":"http://10.15.233.39:8800/feign","method":"GET","error":"","req.size.bytes":0,"resp.size.bytes":18,"remote.host":"10.15.233.39","remote.port":"8800","sys.baggage":"","biz.baggage":""}

The keys are described as follows:

Key

Description

time

The time when the log was recorded.

local.app

The name of the current application.

traceId

The TraceId.

spanId

Span ID

span.kind

The Span type.

result.code

The status code.

current.thread.name

The name of the current thread.

time.cost.milliseconds

The duration of the Span.

request.url

The request URL.

method

Invocation Method

error

The error message.

req.size.bytes

The size of the request data.

resp.size.bytes

The size of the response data.

remote.host

The destination host IP address.

remote.port

The destination port.

sys.baggage

System pass-through baggage data.

biz.baggage

Business pass-through baggage data.

Spring Cloud OpenFeign statistics log

The feign-stat.log file is the Spring Cloud OpenFeign statistics log. The stat.key is a collection of statistical keywords for the current time period. This collection uniquely identifies a set of statistical data and includes the method, local.app, and request.url fields. The following is a sample log:

{"time":"2019-09-03 10:29:34.528","stat.key":{"method":"GET","local.app":"tracer-consumer","request.url":"http://10.15.233.39:8800/feign"},"count":2,"total.cost.milliseconds":378,"success":"true","load.test":"F"}

The following describes the corresponding keys:

Key

Description

time

The time when the log was recorded.

stat.key

method

The invoked method.

local.app

The name of the current application.

request.url

The request URL.

count

The number of requests.

total.cost.milliseconds

The total request duration.

success

The request result:

  • true: The request was successful.

  • false: The request failed.

load.test

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

RPC-to-JVM logs

RPC-to-JVM digest log

In Tracer 1.0.16, a digest log for co-located RPC-to-JVM deployments, rpc-2-jvm-digest.log, was added. The following is a sample log:

2015-04-2717:51:47.711,test,0a0f61eb14301283076901001,0,com.alipay.SampleService,hello,testTarget,21ms,main,test=test,test=test,

The following table describes the example values.

Example value

Description

2015-04-2717:51:47.711

The time when the log was recorded.

test

The name of the current application.

0a0f61eb14301283076901001

Trace ID

0

RPC ID

com.alipay.SampleService

The service name.

hello

The invoked method.

testTarget

The name of the destination system.

21ms

The call duration in milliseconds (ms).

main

The name of the current thread.

test=test

System pass-through data. This is in KV format and is used to transmit system disaster recovery information.

test=test

Business pass-through data in KV format.

Note

The RPC-to-JVM digest log is disabled by default. You can enable it using a DRM push. For more information, see Tracer DRM switches.

RPC-to-JVM call statistics log

The rpc-2-jvm-stat.log file is the RPC-to-JVM call statistics log, which is recorded once every minute. The following is a sample log:

2014-05-2119:18:52.484from,to,DummyService,dummyMethod,596,60041,Y,T

The following table describes the example values.

Example value

Description

2014-05-2119:18:52.484

The time when the log was recorded.

from

The name of the current application.

to

The name of the destination application.

DummyService

The service name.

dummyMethod

Method invocation

596

The number of requests.

60041

The total request duration.

Y

The request result. The rpc-2-jvm log does not record statistics for results, so all results are Y.

T

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

SOFAREST logs

Each SOFAREST call generates corresponding client and server-side execution logs.

SOFAREST client log

The SOFAREST client log is named rest-client-digest.log. The following is a sample log:

2015-11-0411:00:26.556,test,0a0fe9cf14466060265051002,0,http://localhost,insert,anotherApp,10.20.30.40,100,100B,100B,49ms,main,test=test,test=test

The following table describes the example values.

Example value

Description

2015-11-0411:00:26.556

The time when the log was recorded.

test

The name of the current application.

0a0fe9cf14466060265051002

Trace ID

0

RpcId

http://localhost

The request URL.

insert

The invoked method.

anotherApp

The name of the destination application.

10.20.30.40

The destination IP address.

100

The result code.

100B

The size of the response data.

100B

The size of the request data.

49ms

The total request duration.

main

The name of the current thread.

test=test

System pass-through data in KV format, used to transmit system disaster recovery information.

test=test

Business pass-through data in KV format.

SOFAREST server-side log

The SOFAREST server-side log is named rest-server-digest.log. The following is a sample log:

2015-11-0411:00:24.475,test,0a0fe9cf14466060243451001,0,http://localhost,insert,fromApp,fromAddress,400,100B,100B,128ms,main,test=test,test=test

The following table describes the example values.

Field

Description

2015-11-0411:00:24.475

The time when the log was recorded.

test

The name of the current application.

0a0fe9cf14466060243451001

Trace ID

0

RpcId

http://localhost

The request URL.

insert

The invoked method.

fromApp

The name of the source application.

fromAddress

The IP address of the source application.

400

The result code.

100B

The size of the request data.

100B

The size of the response data.

128ms

The total request duration.

main

The name of the current thread.

test=test

System pass-through data in KV format, used to transmit system disaster recovery information.

test=test

Business pass-through data in KV format.

SOFAREST client statistics log

The SOFAREST client statistics log is named rest-client-stat.log and is recorded once every minute. The following is a sample log:

2015-11-0411:00:28.445,test,anotherApp,http://localhost,insert,1,49,Y,F

The following table describes the example values.

Field

Description

2015-11-0411:00:28.445

The time when the log was recorded.

test

The name of the current application.

anotherApp

The name of the destination application.

http://localhost

The request URL.

insert

The invoked method.

1

The number of calls.

49

The total request processing duration.

Y

The processing result:

  • Y: The call was successful.

  • N: The call failed.

F

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

SOFAREST server-side statistics log

The SOFAREST server-side statistics log is named rest-server-stat.log and is recorded once every minute. The following is a sample log:

2015-11-0411:00:26.445,fromApp,test,http://localhost,insert,1,128,N,F

The following table describes the example values.

Field

Description

2015-11-0411:00:26.445

The time when the log was recorded.

fromApp

The name of the source application.

test

The name of the destination application.

http://localhost

The request URL.

insert

Invocation method

1

The number of calls.

128

The total request processing duration.

N

The processing result:

  • Y: The call was successful.

  • N: The call failed.

F

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

SOFA MVC logs

SOFA MVC summary log

The sofa-mvc-digest.log file is the SOFA MVC summary log. The following is a sample log:

2014-09-0100:00:01.631,tbapi,0ad643e114095008015728852,0,http://tbapi.alipay.com/gateway.do,POST,200,1468B,2161B,59ms,catalina-exec-71,uid=13&mark=F&

The following table describes the example values.

Example value

Description

2014-09-0100:00:01.631

The time when the log was recorded.

tbapi

The name of the current application.

0ad643e114095008015728852

Trace ID

0

RpcId

http://tbapi.alipay.com/gateway.do

The request URL.

POST

Method invocation

200

The result code.

1468B

The size of the request data.

2161B

The size of the response data.

59ms

The total request duration.

catalina-exec-71

The name of the current thread.

uid=13&mark=F&

Pass-through data in KV format.

SOFA MVC statistics log

The sofa-mvc-stat.log file is the SOFA MVC statistics log. The following is a sample log:

2014-09-0100:03:22.559,tbapi,http://tbapi.alipay.com/trade/batch_payment.htm,GET,2,11,Y,F

The following table describes the example values.

Example value

Description

2014-09-0100:03:22.559

The time when the log was recorded.

tbapi

The name of the current application.

http://tbapi.alipay.com/trade/batch_payment.htm

The request URL.

GET

Method invocation

2

The number of requests.

11

The total request duration.

Y

The processing result:

  • Y: The call was successful.

  • N: The call failed.

F

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

Exception logs

By default, exception logs are recorded in the middleware_error.log file.

Common exception log

The following is a sample exception log:

2015-02-1022:47:20.499,trade,q241234,0.1,timeout_error,trade|RPC,&protocol=&targetApp=&paramTypes=int|String&invokeType=&methodName=refund&targetUrl=&serviceName=RefundFacade&,,java.lang.Throwable
    at com.alipay.common.tracer.CommonTracerTest.testMiddleware(CommonTracerTest.java:43)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

The log contains the following common information:

Field

Description

Timestamp

The time when the log was generated (UTC+08:00).

TraceId

A 25-digit TraceId. The first 8 digits represent the server IP address, the next 13 digits are the time when the TraceId was generated, and the last 4 digits are an auto-incrementing sequence.

RpcId

RpcId

Fault type

The corresponding fault type is displayed based on the actual situation.

Fault source

The fault source is represented as data:

FaultSource1|FaultSource2|FaultSource3|...

Fault context

The fault context is represented as a mapping:

fromUser=khotyn&toUser=nytohk&

Exception Stack

The specific exception type.

Middleware exception log

The format of middleware product exception logs is the same as the common exception log format. The only difference is that the first item in the fault source specifies the cluster where the fault occurred, as shown below:

FaultCluster|OtherFaultSource1|OtherFaultSource2

RPC client exception log

RPC client exception logs are generated directly in the middleware exception log (middleware_error.log). The basic format is the same as the middleware exception log format, with the following main differences:

  • The second item in the fault source is RPC: FaultCluster|RPC|OtherFaultSource1|OtherFaultSource2.

  • The fault types are as follows:

    • biz_error: A business exception.

    • address_route_error: An address routing exception.

    • timeout_error: A timeout exception.

    • unknown_error: An unknown exception.

  • The fault context contains the following information:

    • serviceName: The service name.

    • methodName: The method name.

    • protocol: The protocol.

    • invokeType: The call type.

    • targetUrl: The destination URL.

    • paramTypes: The request parameter types. The value format is param1|param2.

Sample log

2015-02-1022:47:20.499,trade,q241234,0.1,timeout_error,trade|RPC,&protocol=&targetApp=&paramTypes=int|String&invokeType=&methodName=refund&targetUrl=&serviceName=RefundFacade&,,java.lang.Throwable
    at com.alipay.common.tracer.CommonTracerTest.testMiddleware(CommonTracerTest.java:43)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

RPC server-side exception log

RPC server-side exception logs are generated directly in the middleware exception log (middleware_error.log). The basic format is the same as the middleware exception log format, with the following main differences:

  • The second item in the fault source is RPC: FaultCluster|RPC|OtherFaultSource1|OtherFaultSource2.

  • The fault types are as follows:

    • biz_error: A business exception.

    • unknown_error: An unknown exception.

  • The fault context contains the following information:

    • serviceName: The service name.

    • methodName: The method name.

    • protocol: The protocol.

    • invokeType: The call type.

    • callerUrl: The caller URL.

    • callerApp: The name of the caller application.

    • paramTypes: The request parameter types. The value format is param1|param2.

Sample log

2015-02-1022:47:20.505,trade,q241234,0.1,unknown_error,trade|RPC,protocol=&callerUrl=&paramTypes=int|String&callerApp=&invokeType=&methodName=refund&serviceName=RefundFacade&,,java.lang.Throwable
    at com.alipay.common.tracer.CommonTracerTest.testMiddleware(CommonTracerTest.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

Static information log

The Tracer static information log, static-info.log, records some static information about the current process at startup. The following is a sample log:

84919,10.15.233.110,GZ001

The following table describes the example values.

Example value

Description

84919

The process ID.

10.15.233.110

The current IP address.

GZ001

The current zone.

Distributed transaction logs

Each call to the distributed transaction service generates corresponding client and server-side execution logs.

Distributed transaction client log

The distributed transaction client log is recorded in the ~/logs/tracelog/dtx-client-digest.log file. The log contains the following main information:

Field

Description

Timestamp

The time when the log was recorded.

Local application name

The name of the local application.

Local application address

The IP address of the local application.

Remote application name

The name of the remote application.

Remote application address

The IP address of the remote application.

TraceId

A 29-digit TraceId.

RpcId

RpcId

Service

The service name.

Method

The method name.

Execution duration

The execution duration in milliseconds (ms).

Thread name

The name of the current thread.

Result

The processing result:

  • true: The call was successful.

  • false: The call failed.

System pass-through data

Recorded in KV format.

Business pass-through data

Recorded in KV format.

Sample logs

1. Create a main transaction record (transaction initiation)

2018-06-1117:37:13.151,SofabootAction,10.15.232.41,dtx,11.**.**.74,0a0fe829152870983309010015560,0.93b3fa8c,SofabootAction,start,24ms,Thread-6,true,,
Note

When a distributed transaction is initiated, the 'service name' field contains the name of the initiator's application.

2. Create a branch transaction record

2018-06-1117:37:13.686,SofabootAction,10.15.232.41,dtx,11.**.**.74,0a0fe829152870983309010015560,0.93b3fa8c,tcc_first_action_ds,prepare,22ms,Thread-6,true,,dtx_id=7bb4518951fc4255b68a0eb1cfbad6ef01-0000000000&
Note

When a branch transaction record is created, the 'service name' field contains the ID of the participant resource.

3. Commit a distributed transaction

2018-06-1117:37:14.056,SofabootAction,10.15.232.41,dtx,11.**.**.74,0a0fe829152870983309010015560,0.93b3fa8c,SofabootAction,commit,19ms,Thread-6,true,,dtx_id=7bb4518951fc4255b68a0eb1cfbad6ef01-0000000000&
Note

When a distributed transaction is committed, the 'service name' field contains the name of the initiator's application.

4. Roll back a distributed transaction

2018-06-1117:37:14.056,SofabootAction,10.15.232.41,dtx,11.**.**.74,0a0fe829152870983309010015560,0.93b3fa8c,SofabootAction,rollback,19ms,Thread-6,true,,dtx_id=7bb4518951fc4255b68a0eb1cfbad6ef01-0000000000&
Note

When a distributed transaction is rolled back, the 'service name' field contains the name of the initiator's application.

Distributed transaction server-side log

The distributed transaction server-side log is recorded in the ~/logs/tracelog/dtx-server-digest.log file. The following is a sample log:

2018-10-1210:31:15.438,account-demo,dtx,0a0fe927153931147465010011267,0.93b3fa8c.93b3fa8c.93b3fa8c.93b3fa8c,second_dtx_datasource,commit,11.**.**.74:14200,8ms,dtx-bolt-pool-3,true,test=test,test=test

The following table describes the example values.

Example value

Description

2018-10-1210:31:15.438

The time when the log was recorded.

account-demo

The name of the local application.

dtx

The name of the destination application.

0a0fe927153931147465010011267

A 29-digit TraceId.

0.93b3fa8c.93b3fa8c.93b3fa8c.93b3fa8c

RpcId

second_dtx_datasource

The resource.

commit

Method call

11.**.**.74:14200

The IP address and port of the remote server.

8ms

The total execution duration.

dtx-bolt-pool-3

The name of the current thread.

true

The processing result:

  • true: The call was successful.

  • false: The call failed.

test=test

System pass-through data in KV format, used to transmit system disaster recovery information.

test=test

Business pass-through data in KV format.

Task scheduling logs

Each call to the task scheduling service generates corresponding task distribution and reception logs.

Detailed logs of cluster task distribution

The cluster task distribution digest log records the detailed execution logs of Layer 1 and Layer 2 distributing tasks to their respective next layers. The log is named scheduler-send-digest.log. The following is a sample log:

2015-04-3020:39:56.341,test,0a16191714303975963201001,0,1,21ms,main,test=test,test=test

The following table describes the example values.

Field name

Description

2015-04-3020:39:56.341

The time when the log was recorded.

test

The name of the current application.

0a16191714303975963201001

A 25-digit TraceId.

0

RPC ID

1

Indicates the layer of the three-layer distribution.

21ms

The service call duration.

main

The name of the current thread.

test=test

System pass-through data in KV format, used to transmit system disaster recovery information.

test=test

Business pass-through data in KV format.

Cluster task distribution statistics log

The cluster task distribution statistics log records the statistics of Layer 1 and Layer 2 distributing tasks to their respective next layers. The log is named scheduler-send-stat.log. The following is a sample log:

2015-04-3020:39:58.340,test,0a16191714303975963201001,0,1,1,21,Y,F

The following table describes the example values.

Example value

Description

2015-04-3020:39:58.340

The time when the log was recorded.

test

The name of the current application.

0a16191714303975963201001

A 25-digit TraceId.

0

RpcId

1

Indicates the layer of the three-layer distribution.

1

The number of calls.

21

The total call duration.

Y

The call result:

  • Y: The call was successful.

  • N: The call failed.

F

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.

Cluster task reception digest log

The cluster task reception digest log records the detailed execution logs of Layer 2 and Layer 3 receiving tasks from their respective previous layers. The log is named scheduler-receive-digest.log. The following is a sample log:

2015-04-3020:39:58.358,test,0a16191714303975983561002,0,1,2ms,main,test=test

The following table describes the example values.

Example value

Description

2015-04-3020:39:58.358

The time when the log was recorded.

test

The name of the current application.

0a16191714303975983561002

Trace ID

0

RpcId

1

Indicates the layer of the three-layer distribution.

2ms

The service call duration in milliseconds (ms).

main

The name of the current thread.

test=test

Pass-through data in KV format.

Cluster task reception statistics log

The cluster task reception statistics log records the statistics of Layer 2 and Layer 3 receiving tasks from their respective previous layers. The log is named scheduler-receive-stat.log. The following are example values:

2015-04-3020:40:00.339,test,1,1,2,Y,F

The following table describes the example values.

Example value

Description

2015-04-3020:40:00.339

The time when the log was recorded.

test

The name of the current application.

1

Indicates the layer of the three-layer distribution.

1

The number of calls within this time period.

2

The total call duration within this time period.

Y

The call result:

  • Y: The call was successful.

  • N: The call failed.

F

Indicates whether the current request is part of an end-to-end stress test:

  • T: The request is part of an end-to-end stress test. The log context is available in the current thread and contains stress testing information.

  • F: The request is not part of an end-to-end stress test. The log context is not available in the current thread, or the context does not contain stress testing information.