# Docker-error: no log4j2.properties found; tried \[/usr/share/elasticsearch/config\] and its subdirectories

**URL:** <https://discuss.elastic.co/t/docker-error-no-log4j2-properties-found-tried-usr-share-elasticsearch-config-and-its-subdirectories/109760>\
**Category:** Elasticsearch\
**Created:** [November 30, 2017, 1:50pm UTC](https://discuss.elastic.co/t/docker-error-no-log4j2-properties-found-tried-usr-share-elasticsearch-config-and-its-subdirectories/109760 "2017-11-30T13:50:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marouane/32/83858_2.png) [@marouane](https://discuss.elastic.co/u/marouane)\
**Post date:** [November 30, 2017, 1:50pm UTC](https://discuss.elastic.co/t/docker-error-no-log4j2-properties-found-tried-usr-share-elasticsearch-config-and-its-subdirectories/109760/1 "2017-11-30T13:50:05Z")

</div>

Hello every one  
i'm new with elasticsearsh  
Those are the steps that i followed 🙂

- docker pull elasticsearch:5.2.2

- docker run -d --name=ElasticSearch --restart=unless-stopped -v /myfolder/elasticsearch/config:/usr/share/elasticsearch/config -v /var/docker/containers/elasticsearch/data:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e ES\_JAVA\_OPTS="-Xms8g -Xmx8g" elasticsearch

- docker ps :  
e1425864a03c elasticsearch "/docker-entrypoin..." 4 hours ago Up 3 hours 0.0.0.0:9200-\>9200/tcp, 0.0.0.0:9300-\>9300/tcp ElasticSearch

after that i want to access , myadresse ip :9200 but i got no thing

- docker logs e1425864a03c

ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories  
ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories  
ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories  
ERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories

What's wrong in those steps , also i don't know how can i add the log4j2.properties

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 3, 2017, 4:27pm UTC](https://discuss.elastic.co/t/docker-error-no-log4j2-properties-found-tried-usr-share-elasticsearch-config-and-its-subdirectories/109760/2 "2017-12-03T16:27:01Z")

</div>

It is because you've overwritten the config directory completely with another external directory `/myfolder/elasticsearch/config` and the `log4j2.properties` lives there.

I recommend that you overwrite only the `elasticsearch.yml` as described here [https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docker.html#\_b\_bind\_mounted\_configuration](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docker.html#_b_bind_mounted_configuration) instead of the whole config directory.

---

<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:** [December 31, 2017, 4:27pm UTC](https://discuss.elastic.co/t/docker-error-no-log4j2-properties-found-tried-usr-share-elasticsearch-config-and-its-subdirectories/109760/3 "2017-12-31T16:27:42Z")

</div>

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