Kong Api Gateway http-log如何运作

时间:2017-02-21 07:09:26

标签: linux kong

根据Kong文件

**

$ curl -X POST http://kong:8001/apis/{api}/plugins \
    --data "name=http-log" \
    --data "config.http_endpoint=http://mockbin.org/bin/:id/" \
    --data "config.method=POST" \
    --data "config.timeout=1000" \
    --data "config.keepalive=1000"

**

日志将在http_endpoint创建。 我无法理解kong http-log是如何工作的。 假设我的请求主机是在我的本地系统中安装的x.x.x.x和kong,在添加http-log plugin后我应该在哪里查找生成的日志。是否可以使用控制台访问http-log?

2 个答案:

答案 0 :(得分:0)

  

HTTP日志 -   将请求和响应日志发送到HTTP服务器。

config.http_endpoint是您可以查看日志的日志服务器

答案 1 :(得分:0)

您必须在指定为config.http_endpoint的位置创建一个侦听器。端点必须处理config.method。它将收到一个包含所有日志信息的大JSON。

click here

检查示例日志JSON

我的建议:

此处的最佳选择是将此终点设置为弹性搜索终点以接收所有日志,并在弹性顶部使用Kibana UI将可视化添加到日志数据中。