在前文中完成了api網關kong、konga面板的部署,在將後端應用發佈到網關以後,就須要對應用的日誌進行統一管理。因爲咱們生產環境選擇將kong部署進K8S環境,所以選型以後,決定採用http-log插件的方式實現日誌的統一收集,並將日誌發送到logstash服務,而後對接elasticsearch,最終由kibana面板來展現和查詢。後端
訪問konga面板,添加http-log插件
填寫logstash服務端的ip和端口api
yum -y install logstash cat /etc/logstash/conf.d/http_log.conf input { http { host => "0.0.0.0" port => 9000 ssl => false threads => 2 } } filter { mutate { remove_field => ["headers"] } } output { elasticsearch { hosts => ["192.168.223.235:9200"] index => "kong_log_%{+YYYY-MM-dd}" } } /usr/share/logstash/bin/logstash -f /etc/logstash/http_log.conf &