# Enable debug logging on metricbeat using a docker CMD

**URL:** https://discuss.elastic.co/t/enable-debug-logging-on-metricbeat-using-a-docker-cmd/308006
**Category:** Beats
**Tags:** docker, metricbeat
**Created:** [June 23, 2022, 12:28pm UTC](https://discuss.elastic.co/t/enable-debug-logging-on-metricbeat-using-a-docker-cmd/308006 "2022-06-23T12:28:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)
#### Post date: [June 23, 2022, 12:28pm UTC](https://discuss.elastic.co/t/enable-debug-logging-on-metricbeat-using-a-docker-cmd/308006/1 "2022-06-23T12:28:02Z")

</div>

If I'm running metricbeat in docker, how can I enable debug logging?

So far I've tried

1. `./metricbeat setup -E logging.level="debug" && ./metricbeat`
2. `./metricbeat -d "*"`

but I can't get it to work.

I'm expecting the logs to appear in stdout when running in docker (so they're visible using `docker logs` command). Is that incorrect?

---

<div class="post-metadata">

### Author: ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)
#### Post date: [June 23, 2022, 1:07pm UTC](https://discuss.elastic.co/t/enable-debug-logging-on-metricbeat-using-a-docker-cmd/308006/2 "2022-06-23T13:07:40Z")

</div>

Turns out you need the -e flag to write to stdout.

---

<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: [July 21, 2022, 3:07pm UTC](https://discuss.elastic.co/t/enable-debug-logging-on-metricbeat-using-a-docker-cmd/308006/3 "2022-07-21T15:07:53Z")

</div>

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