# How to Log with Kong

**URL:** https://discuss.konghq.com/t/how-to-log-with-kong/1504
**Category:** Questions
**Created:** [July 18, 2018, 9:01am UTC](https://discuss.konghq.com/t/how-to-log-with-kong/1504 "2018-07-18T09:01:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![i3yaki](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@i3yaki](https://discuss.konghq.com/u/i3yaki)
#### Post date: [July 18, 2018, 9:01am UTC](https://discuss.konghq.com/t/how-to-log-with-kong/1504/1 "2018-07-18T09:01:37Z")

</div>

Hi !

I am trying to log every request called to Kong but I don’t understand how to use the plugin Http Log.  
I read [https://docs.konghq.com/plugins/http-log/](https://docs.konghq.com/plugins/http-log/)  
But when I added the plugin :  
{  
“created\_at”: 1531839288000,  
“config”: {  
“http\_endpoint”: “[http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb](http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb)”,  
“timeout”: 1000,  
“method”: “POST”,  
“keepalive”: 1000,  
“content\_type”: “application/json”  
},  
“id”: “96035659-402c-454c-b204-0b54df8466d2”,  
“name”: “http-log”,  
“service\_id”: “23380fd8-5a4a-4969-b2da-ab477dd1edfb”,  
“enabled”: true  
}  
When I try to look at [http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb](http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb) or  
[http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb/log](http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb/log) or  
[http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb/view](http://mockbin.org/bin/c88a0365-f6ab-49f9-9674-38283764dfcb/view)

There is nothing.  
I am not sure about how to use mockbin and http log.  
If anyone know how to use it and can explain it i’ll be grateful.

---

<div class="post-metadata">

### Author: ![kikito](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/kikito/32/15_2.png) [@kikito](https://discuss.konghq.com/u/kikito)
#### Post date: [July 18, 2018, 10:05am UTC](https://discuss.konghq.com/t/how-to-log-with-kong/1504/2 "2018-07-18T10:05:44Z")

</div>

Hello, the http log plugin is a “request logger” - for each request/response pair that goes through Kong, the plugin makes an http request.

If you have only configured the plugin but made no requests through Kong, the plugin will be installed, but it will never activate. You need to make some traffic go through Kong in order for it to appear in your mockbin instances.

---

<div class="post-metadata">

### Author: ![i3yaki](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@i3yaki](https://discuss.konghq.com/u/i3yaki)
#### Post date: [July 18, 2018, 10:29am UTC](https://discuss.konghq.com/t/how-to-log-with-kong/1504/3 "2018-07-18T10:29:27Z")

</div>

I did, but nothing happened

---

<div class="post-metadata">

### Author: ![kikito](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/kikito/32/15_2.png) [@kikito](https://discuss.konghq.com/u/kikito)
#### Post date: [July 18, 2018, 10:42am UTC](https://discuss.konghq.com/t/how-to-log-with-kong/1504/4 "2018-07-18T10:42:15Z")

</div>

Maybe the traffic you are generating is not triggering the plugin.

- First, make sure that the traffic you are generating goes through Kong (not directly to the upstream server)
- Also, check that the traffic matches the service `23380fd8-5a4a-4969-b2da-ab477dd1edfb`, which is the one associated with your http-log plugin. You must send your request to a [route associated to that service](https://docs.konghq.com/0.14.x/getting-started/configuring-a-service/#forward-your-requests-through-kong).
- Check that you are getting the expected responses from your traffic.
- Give a look at the nginx logs and see if there are any errors happening while the traffic goes though Kong.

---

<div class="post-metadata">

### Author: ![i3yaki](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@i3yaki](https://discuss.konghq.com/u/i3yaki)
#### Post date: [July 18, 2018, 11:25am UTC](https://discuss.konghq.com/t/how-to-log-with-kong/1504/5 "2018-07-18T11:25:53Z")

</div>

I added the plugin to be global so it should be activated by any services.  
But now I think about using StatsD plugin instead of the Http Log.  
It may be more useful in my case.  
But I don’t understand how to use it.  
I receive an error in my logs : send() failed (111: Connection refused) […] statsd\_logger.lua:71: send\_statsd(): failed to send data to localhost:8125: connection refused

I suppose that is because localhost:8125 is not a StatsD server but I am not sure about that.  
And if it is for this reason I would like to know if there is an StatsD online to test it instead of installing one.

---

<div class="post-metadata">

### Author: ![kikito](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/kikito/32/15_2.png) [@kikito](https://discuss.konghq.com/u/kikito)
#### Post date: [July 23, 2018, 10:58am UTC](https://discuss.konghq.com/t/how-to-log-with-kong/1504/6 "2018-07-23T10:58:23Z")

</div>

The `connection refused` message seems to indicate that `localhost:8125` is not available _at all_ - your problem seems to be network-related more than protocol-related.

If you are using Kong from inside Docker, you might need to change `localhost` by `host.docker.internal`. More info in [Explore networking features on Docker Desktop | Docker Docs](https://docs.docker.com/docker-for-mac/networking/) .

> if there is an StatsD online to test it instead of installing one.

I’m sorry, I know no such service.
