# No log4j2 configuration file found

**URL:** https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543
**Category:** Elasticsearch
**Created:** [May 21, 2017, 12:25am UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543 "2017-05-21T00:25:03Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![froufrou2224](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@froufrou2224](https://discuss.elastic.co/u/froufrou2224)
#### Post date: [May 21, 2017, 12:25am UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543/1 "2017-05-21T00:25:03Z")

</div>

Hello,  
I tried to import a Maven Project on Eclipse, but there's problem. Eclipse sent me this :

`ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.`

But, I checked and I have a log4j2.properties in the path src/main/resources :

```
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
rootLogger.level = info
rootLogger.appenderRef.console.ref = console 

```

This is my pom.xml :

```
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>projet</groupId>
  <artifactId>google</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>google</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
	
	<dependency>
		<groupId>org.elasticsearch.client</groupId>
		<artifactId>transport</artifactId>
		<version>5.4.0</version>
	</dependency>
	
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.8.2</version>
</dependency>

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.8.2</version>
</dependency>

  </dependencies>
  
    <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <mainClass>org.ccm.maven.App</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

```

That's my app.java that I tried to compile :

```
package projet;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.transport.client.PreBuiltTransportClient;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
    	// on startup
    	
    	
        try{
    		TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
    		        .addTransportAddress(new InetSocketTransportAddress(InetAddress.getLocalHost(), 9300));
    		}
    		catch(UnknownHostException u){
    		  System.out.println("exception:" + u.getMessage());
    		  u.printStackTrace();
    		}
    	
		}
}

```

It's weird because I always think, when I modify my files, to compile with "mvn compile" or refresh on Eclipse.

Thank you for your answers. 😉

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 22, 2017, 8:05am UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543/2 "2017-05-22T08:05:37Z")

</div>

This is happening when you launch from eclipse or from the command line?

---

<div class="post-metadata">

### Author: ![froufrou2224](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@froufrou2224](https://discuss.elastic.co/u/froufrou2224)
#### Post date: [May 22, 2017, 12:37pm UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543/3 "2017-05-22T12:37:04Z")

</div>

This is when I launch from eclipse 😉

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 22, 2017, 2:10pm UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543/4 "2017-05-22T14:10:24Z")

</div>

My bet is that something is not well configured within eclipse.  
But as I'm not using eclipse for more than 4 years now I doubt I can help more.

At least check that you have all files in the target/classes dir.

---

<div class="post-metadata">

### Author: ![froufrou2224](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@froufrou2224](https://discuss.elastic.co/u/froufrou2224)
#### Post date: [May 22, 2017, 10:44pm UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543/5 "2017-05-22T22:44:36Z")

</div>

I will check that. But have you got a simple example of Java classes in ElasticSearch ?  
An example which create an index, add a Document and search this Document.

Thank you for your help !

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 23, 2017, 1:24pm UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543/6 "2017-05-23T13:24:27Z")

</div>

- Create a client: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html)
- Create an index: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html#java-admin-indices-create-index](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html#java-admin-indices-create-index)
- Add a document: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-index.html#java-docs-index-doc](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-index.html#java-docs-index-doc)
- Search for a document: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-search.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-search.html)

---

<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: [June 20, 2017, 1:24pm UTC](https://discuss.elastic.co/t/no-log4j2-configuration-file-found/86543/7 "2017-06-20T13:24:48Z")

</div>

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