Skip to content

Latest commit

 

History

History
83 lines (71 loc) · 1.76 KB

Log-Data-Protocol.md

File metadata and controls

83 lines (71 loc) · 1.76 KB

Log Data Protocol

Report log data via protocol.

Native Proto Protocol

Report native-proto format log via gRPC.

gRPC service define

Native Kafka Protocol

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"
        }
    }
}

HTTP API

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"
      }
    }
  }
]