# No logs is geeting generated

**URL:** https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006
**Category:** Questions
**Created:** [October 2, 2018, 3:39pm UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006 "2018-10-02T15:39:22Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![sharmmoh1983](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sharmmoh1983](https://discuss.konghq.com/u/sharmmoh1983)
#### Post date: [October 2, 2018, 3:39pm UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/1 "2018-10-02T15:39:22Z")

</div>

I am getting following error : {“message”:“An unexpected error occurred”} while calling an api enabled with custom plugin

There are no error logs getting generated . Where to see what went wrong?

curl -X POST [http://kong:8001/apis](http://kong:8001/apis)  
–data name=headers-api  
–data uris=/headers  
–data strip\_uri=false  
–data upstream\_url=https://httpbin.org

curl -X POST [http://kong:8001/apis/headers-api/plugins](http://kong:8001/apis/headers-api/plugins)  
–data name=middleman \

```auto
 curl -X POST http://kong:8001/apis/headers-api/plugins \
--data "name=middleman" \
--data "config.url=http://dockerApi:8092/api/dockets" \
--data "config.response=table" \
--data "config.timeout=10000" \
--data "config.keepalive=60000" \
--data "config.body_data"="{ \"title\": \"foo\",\"body\": \"bar\",\"userId\": 1 }"

```

---

<div class="post-metadata">

### Author: ![thibaultcha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/thibaultcha/32/340_2.png) [@thibaultcha](https://discuss.konghq.com/u/thibaultcha)
#### Post date: [October 2, 2018, 5:22pm UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/2 "2018-10-02T17:22:39Z")

</div>

Hi,

> There are no error logs getting generated.

There most certainly _are_ logs, but you might be looking for them in the wrong place. If you read the current configuration of your Kong node, like so:

```auto
$ curl -s http://kong:8001 | jq '.configuration.admin_acc_logs'

```

You will get the path at which Kong writes error logs for the Admin API. Source: [Admin API - v3.5.x | Kong Docs](https://docs.konghq.com/latest/admin-api/#retrieve-node-information). (Note the use of [jq](https://stedolan.github.io/jq/) in the above command, for brevity).

The path for Admin API error logs is most likely to be the same as that of the proxy, unless you configured it to be different. [By default in the current latest release](https://github.com/Kong/kong/blob/0.14.1/kong.conf.default#L45-L57), both point to `<prefix>/logs/error.log`.

**Where are you looking for those logs right now? If you are still having problems locating them, please indicate which version of Kong you are using.** Most likely, this is an issue with the [middleman](https://github.com/pantsel/kong-middleman-plugin) plugin, and you would have to report it to its author, as we are not responsible for its maintainership.

---

<div class="post-metadata">

### Author: ![sharmmoh1983](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sharmmoh1983](https://discuss.konghq.com/u/sharmmoh1983)
#### Post date: [October 3, 2018, 12:28pm UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/3 "2018-10-03T12:28:43Z")

</div>

Hi  
There no entry in the logs you mentioned above. Any how thanks for the input…  
I was looking for a plugin that will do role based authorization with JWT token validation

Do you have any idea abt custom plugin which does that?

---

<div class="post-metadata">

### Author: ![thibaultcha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/thibaultcha/32/340_2.png) [@thibaultcha](https://discuss.konghq.com/u/thibaultcha)
#### Post date: [October 3, 2018, 3:04pm UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/4 "2018-10-03T15:04:14Z")

</div>

Like I said, the file I mentioned might not necessarily be the file that you should be looking into. Please share more information with us: what is the `log_level` you configured for your Kong node? And which `prefix` is Kong running into, as well as what are the files in the `<prefix>/logs` directory? When such an internal error happens, Kong/OpenResty **does** generate a log at the `error` level.

---

<div class="post-metadata">

### Author: ![sharmmoh1983](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sharmmoh1983](https://discuss.konghq.com/u/sharmmoh1983)
#### Post date: [October 4, 2018, 3:45am UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/5 "2018-10-04T03:45:31Z")

</div>

Hi  
I could see logs when I run docker kong container logs

Here are the following properties

log\_level = “notice”

prefix = “/usr/local/kong”

---

<div class="post-metadata">

### Author: ![thibaultcha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/thibaultcha/32/340_2.png) [@thibaultcha](https://discuss.konghq.com/u/thibaultcha)
#### Post date: [October 4, 2018, 3:49am UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/6 "2018-10-04T03:49:00Z")

</div>

If you run the Kong docker image, then logs are indeed written to stdout/stderr. The more we know about how you are running Kong, the better we can help you. You were able to see the logs right?

---

<div class="post-metadata">

### Author: ![sharmmoh1983](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sharmmoh1983](https://discuss.konghq.com/u/sharmmoh1983)
#### Post date: [October 4, 2018, 4:08am UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/7 "2018-10-04T04:08:32Z")

</div>

I am running Kong docker image I am able to see logs in stdout/stderr which are container logs.

But when I see in the container /usr/local/kong/access.log and /usr/local/kong/error.log . these are empty files.

Please let me know what information is required by you to know why logs are not getting created in desired location

---

<div class="post-metadata">

### Author: ![thibaultcha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/thibaultcha/32/340_2.png) [@thibaultcha](https://discuss.konghq.com/u/thibaultcha)
#### Post date: [October 4, 2018, 4:11am UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/8 "2018-10-04T04:11:49Z")

</div>

The docker images purposefully writes logs to stdout/stderr instead of writing them to files within the container, and for good reason. With lack of support for rotting logs _out_ of the container, writing them to a file within the container would fill the disk space available to your container, causing it to crash. This has happened to some users in the past. Your monitoring solution should consider playing nice with the container logs, this is perfectly normal.

---

<div class="post-metadata">

### Author: ![sharmmoh1983](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sharmmoh1983](https://discuss.konghq.com/u/sharmmoh1983)
#### Post date: [October 4, 2018, 4:49am UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/9 "2018-10-04T04:49:36Z")

</div>

Thanks @thibaultcha for your support. Just one question which is not related to the current issue which as follows:

Is it possible to achieve changing priority of kong built in plugins precedence of execution while enabling them?

---

<div class="post-metadata">

### Author: ![thibaultcha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/thibaultcha/32/340_2.png) [@thibaultcha](https://discuss.konghq.com/u/thibaultcha)
#### Post date: [October 4, 2018, 4:52am UTC](https://discuss.konghq.com/t/no-logs-is-geeting-generated/2006/10 "2018-10-04T04:52:54Z")

</div>

> Is it possible to achieve changing priority of kong built in plugins precedence of execution while enabling them?

No, not without forking them as of today at least. Since this is already being discussed at [Overide plugin priority : Custome priority](https://discuss.konghq.com/t/overide-plugin-priority-custome-priority/2021), let’s not diverge from the original topic here and let’s keep each discussion separate from each other, thanks 🙂
