# Unable to set logging level for docker container

**URL:** <https://discuss.elastic.co/t/unable-to-set-logging-level-for-docker-container/374073>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [February 4, 2025, 4:42pm UTC](https://discuss.elastic.co/t/unable-to-set-logging-level-for-docker-container/374073 "2025-02-04T16:42:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![instantdreams](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/instantdreams/32/141148_2.png) [@instantdreams](https://discuss.elastic.co/u/instantdreams)\
**Post date:** [February 4, 2025, 4:42pm UTC](https://discuss.elastic.co/t/unable-to-set-logging-level-for-docker-container/374073/1 "2025-02-04T16:42:28Z")

</div>

I have an elasticsearch container using the following compose.yaml file:

```YAML
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:latest
    container_name: elasticsearch
    expose:
      - 9200
    env_file:
      - .env
    volumes:
      - ${DIRECTORY_DATA}:/usr/share/elasticsearch/data
      - ${DIRECTORY_SNAPSHOT}:/usr/share/elasticsearch/data/snapshot
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped

```

With the following .env file:

```auto
# Directory locations
DIRECTORY_DATA=/srv/elasicsearch/data
DIRECTORY_SNAPSHOT=/srv/elasticsearch/snapshot
# Container specifics
## elastic-search
ES_JAVA_OPTS=-Xms512m -Xmx512m
xpack.security.enabled=true
discovery.type=single-node
path.repo=/usr/share/elasticsearch/data/snapshot
ES_SETTING_LOGGER_ORG_ELASTICSEARCH_DISCOVERY=WARN
logger.org.elasticsearch.discovery=WARN
ES_SETTING_LOGGER_DISCOVERY_LEVEL=WARN
logger.discovery.level=WARN
ES_SETTING_LOGGER_ACTION_LEVEL=WARN
logger.action.level=warn
ES_SETTING_LOGGER_DEPRECIATION_LEVEL=WARN
logger.depreciation.level=warn

```

I am trying to set my log level to warnings only, and have reviewed [application logging](https://www.elastic.co/guide/en/elasticsearch/reference/current/logging.html), [configuring ES with docker](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-configuration-methods), but I can't seem to find any clear documentation on just setting the log level.

Does anyone know how to set the logging level for elasticsearch using docker environment variables?
