Report log data via protocol.
Report native-proto
format log via gRPC.
Report native-json
format log via kafka.
Json log record example:
{
"timestamp":1618161813371,
"service":"Your_ApplicationName",
"serviceInstance":"[email protected]",
"traceContext":{
"traceId":"ddd92f52207c468e9cd03ddd107cd530.69.16181331190470001",
"spanId":"0",
"traceSegmentId":"ddd92f52207c468e9cd03ddd107cd530.69.16181331190470000"
},
"tags":{
"data":[
{
"key":"level",
"value":"INFO"
},
{
"key":"logger",
"value":"com.example.MyLogger"
}
]
},
"body":{
"text":{
"text":"log message"
}
}
}
Report json
format logs via HTTP API, the endpoint is http://<oap-address>:12800/v3/logs
.
Json log record example:
[
{
"timestamp": 1618161813371,
"service": "Your_ApplicationName",
"serviceInstance": "[email protected]",
"traceContext": {
"traceId": "ddd92f52207c468e9cd03ddd107cd530.69.16181331190470001",
"spanId": "0",
"traceSegmentId": "ddd92f52207c468e9cd03ddd107cd530.69.16181331190470000"
},
"tags": {
"data": [
{
"key": "level",
"value": "INFO"
},
{
"key": "logger",
"value": "com.example.MyLogger"
}
]
},
"body": {
"text": {
"text": "log message"
}
}
}
]