We’re using http-log to send request and response logs to our own http server. But we notice that only part of the logs could be received by our server. If we make 10 concurrent requests, the server could only receive 6-7 logs . (But if we send logs directly to http server, it could easily handle more than 100 logs ). There’s no error recorded in error.log.
So we are wondering why and how to fix it.
---------enable http-log plugin for kong
curl -X POST http://kong:8001/plugins \
–data “name=http-log” \
–data “config.http_endpoint=[our http server]” \
–data “config.method=POST” \
–data “config.timeout=10000” \
Which version of Kong are you using?
I’ve looked at the source code of the http-log plugin and the error messages it throws look like this, in case you want to grep for them specifically in your logs:
failed to connect to <host:port>
failed to do SSL handshake with <host:port>
failed to send data to <host:port>
failed to keepalive to <host:port>
I’m using 0.13.1.
I don’t see any error message in the error.log. And I modified the http-log plugin a little bit so it can show something if it is ok (after the error message).
if ok then
ngx.log(ngx.INFO, name … "succeed to send data to " … host … “:” … tostring(port) … ": ")
And then I got right amount of succeeds in my logs. But still i could only received some of them.
This is so confusing
We finally figured it out. We assumed wrongly that http-log would create different connections for every log. After looking into the request, we found there might be more than 1 log sent in a connection. So we modified our service and it’s working right now.