mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-05 21:47:36 +08:00
feat(kafka-logger): add server info to kafka log (#4131)
This commit is contained in:
parent
c8c24deca4
commit
d4a999db42
@ -52,6 +52,10 @@ local function get_full_log(ngx, conf)
|
|||||||
headers = ngx.resp.get_headers(),
|
headers = ngx.resp.get_headers(),
|
||||||
size = var.bytes_sent
|
size = var.bytes_sent
|
||||||
},
|
},
|
||||||
|
server = {
|
||||||
|
hostname = core.utils.gethostname(),
|
||||||
|
version = core.version.VERSION
|
||||||
|
},
|
||||||
upstream = var.upstream_addr,
|
upstream = var.upstream_addr,
|
||||||
service_id = service_id,
|
service_id = service_id,
|
||||||
route_id = route_id,
|
route_id = route_id,
|
||||||
|
@ -64,7 +64,44 @@ For more info on Batch-Processor in Apache APISIX please refer.
|
|||||||
- **default**:
|
- **default**:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"upstream":"127.0.0.1:1980","start_time":1602211788041,"client_ip":"127.0.0.1","service_id":"","route_id":"1","request":{"querystring":{"ab":"cd"},"size":90,"uri":"\/hello?ab=cd","url":"http:\/\/localhost:1984\/hello?ab=cd","headers":{"host":"localhost","content-length":"6","connection":"close"},"body":"abcdef","method":"GET"},"response":{"headers":{"content-type":"text\/plain","server":"APISIX\/1.5","connection":"close","transfer-encoding":"chunked"},"status":200,"size":153},"latency":99.000215530396}
|
{
|
||||||
|
"upstream": "127.0.0.1:1980",
|
||||||
|
"start_time": 1619414294760,
|
||||||
|
"client_ip": "127.0.0.1",
|
||||||
|
"service_id": "",
|
||||||
|
"route_id": "1",
|
||||||
|
"request": {
|
||||||
|
"querystring": {
|
||||||
|
"ab": "cd"
|
||||||
|
},
|
||||||
|
"size": 90,
|
||||||
|
"uri": "/hello?ab=cd",
|
||||||
|
"url": "http://localhost:1984/hello?ab=cd",
|
||||||
|
"headers": {
|
||||||
|
"host": "localhost",
|
||||||
|
"content-length": "6",
|
||||||
|
"connection": "close"
|
||||||
|
},
|
||||||
|
"body": "abcdef",
|
||||||
|
"method": "GET"
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"headers": {
|
||||||
|
"connection": "close",
|
||||||
|
"content-type": "text/plain; charset=utf-8",
|
||||||
|
"date": "Mon, 26 Apr 2021 05:18:14 GMT",
|
||||||
|
"server": "APISIX/2.5",
|
||||||
|
"transfer-encoding": "chunked"
|
||||||
|
},
|
||||||
|
"size": 190,
|
||||||
|
"status": 200
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"hostname": "localhost",
|
||||||
|
"version": "2.5"
|
||||||
|
},
|
||||||
|
"latency": 0
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **origin**:
|
- **origin**:
|
||||||
|
@ -62,7 +62,44 @@ title: kafka-logger
|
|||||||
- **default**:
|
- **default**:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"upstream":"127.0.0.1:1980","start_time":1602211788041,"client_ip":"127.0.0.1","service_id":"","route_id":"1","request":{"querystring":{"ab":"cd"},"size":90,"uri":"\/hello?ab=cd","url":"http:\/\/localhost:1984\/hello?ab=cd","headers":{"host":"localhost","content-length":"6","connection":"close"},"body":"abcdef","method":"GET"},"response":{"headers":{"content-type":"text\/plain","server":"APISIX\/1.5","connection":"close","transfer-encoding":"chunked"},"status":200,"size":153},"latency":99.000215530396}
|
{
|
||||||
|
"upstream": "127.0.0.1:1980",
|
||||||
|
"start_time": 1619414294760,
|
||||||
|
"client_ip": "127.0.0.1",
|
||||||
|
"service_id": "",
|
||||||
|
"route_id": "1",
|
||||||
|
"request": {
|
||||||
|
"querystring": {
|
||||||
|
"ab": "cd"
|
||||||
|
},
|
||||||
|
"size": 90,
|
||||||
|
"uri": "/hello?ab=cd",
|
||||||
|
"url": "http://localhost:1984/hello?ab=cd",
|
||||||
|
"headers": {
|
||||||
|
"host": "localhost",
|
||||||
|
"content-length": "6",
|
||||||
|
"connection": "close"
|
||||||
|
},
|
||||||
|
"body": "abcdef",
|
||||||
|
"method": "GET"
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"headers": {
|
||||||
|
"connection": "close",
|
||||||
|
"content-type": "text/plain; charset=utf-8",
|
||||||
|
"date": "Mon, 26 Apr 2021 05:18:14 GMT",
|
||||||
|
"server": "APISIX/2.5",
|
||||||
|
"transfer-encoding": "chunked"
|
||||||
|
},
|
||||||
|
"size": 190,
|
||||||
|
"status": 200
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"hostname": "localhost",
|
||||||
|
"version": "2.5"
|
||||||
|
},
|
||||||
|
"latency": 0
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **origin**:
|
- **origin**:
|
||||||
|
Loading…
Reference in New Issue
Block a user