How to properly configure Log4J 2?

Are you using the TransportClient here?

May be read this: https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_log4j_2_logger.html