# Unable to view debug logs

**URL:** <https://discuss.elastic.co/t/unable-to-view-debug-logs/251011>\
**Category:** APM\
**Created:** [October 5, 2020, 2:37pm UTC](https://discuss.elastic.co/t/unable-to-view-debug-logs/251011 "2020-10-05T14:37:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohit\_kumar1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohit_kumar1/32/76666_2.png) [@rohit\_kumar1](https://discuss.elastic.co/u/rohit_kumar1)\
**Post date:** [October 5, 2020, 2:37pm UTC](https://discuss.elastic.co/t/unable-to-view-debug-logs/251011/1 "2020-10-05T14:37:58Z")

</div>

While instrumenting python framework, where to view the debug logs.

example:  
In transport/http.py:

there is a call as given below:  
`logger.debug("Sent request, url=%s size=%.2fkb status=%s", url, len(data) / 1024.0, response.status)`

Where to see this kind of log, and what are the steps to enable if not enabled by default

---

<div class="post-metadata">

**Author:** ![Emanuil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuil/32/36783_2.png) [@Emanuil](https://discuss.elastic.co/u/Emanuil)\
**Post date:** [October 5, 2020, 2:54pm UTC](https://discuss.elastic.co/t/unable-to-view-debug-logs/251011/2 "2020-10-05T14:54:07Z")

</div>

I assume you're talking about the Elastic APM Python Agent since you're talking about instrumenting. You need to enable debug-level logging. [See the agent docs on logging config for instructions on that.](https://www.elastic.co/guide/en/apm/agent/python/current/troubleshooting.html#agent-logging)

EDIT: I've moved your topic to the APM section of the forum from the Elasticsearch section - in case you search for it.

---

<div class="post-metadata">

**Author:** ![rohit\_kumar1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohit_kumar1/32/76666_2.png) [@rohit\_kumar1](https://discuss.elastic.co/u/rohit_kumar1)\
**Post date:** [October 5, 2020, 3:04pm UTC](https://discuss.elastic.co/t/unable-to-view-debug-logs/251011/3 "2020-10-05T15:04:21Z")

</div>

Thank you so much.  
It worked.

1 Follow up , it is insisting to add a version key with value 1 any idea why?

---

<div class="post-metadata">

**Author:** ![Emanuil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuil/32/36783_2.png) [@Emanuil](https://discuss.elastic.co/u/Emanuil)\
**Post date:** [October 5, 2020, 3:13pm UTC](https://discuss.elastic.co/t/unable-to-view-debug-logs/251011/4 "2020-10-05T15:13:11Z")

</div>

Where is it adding that? Could you post an example message or screenshot of what you mean?

---

<div class="post-metadata">

**Author:** ![rohit\_kumar1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohit_kumar1/32/76666_2.png) [@rohit\_kumar1](https://discuss.elastic.co/u/rohit_kumar1)\
**Post date:** [October 7, 2020, 3:25pm UTC](https://discuss.elastic.co/t/unable-to-view-debug-logs/251011/5 "2020-10-07T15:25:52Z")

</div>

in settings.py we have to put below dictionary:

LOGGING = {  
'handlers': {  
'console': {  
'level': 'DEBUG',  
'class': 'logging.StreamHandler'  
}  
},  
'loggers': {  
'elasticapm': {  
'level': 'DEBUG',  
'handlers': ['console']  
},  
},  
**'version': 1,**  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2020, 3:26pm UTC](https://discuss.elastic.co/t/unable-to-view-debug-logs/251011/6 "2020-11-04T15:26:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
