Maven - ERROR StatusLogger No log4j2 configuration file found

error no log4j2 configuration file found - elasticsearch
error statuslogger no log4j2 configuration file found appdynamics
error statuslogger no log4j2 configuration file found jmeter
log4j configuration file
error statuslogger no log4j 2 configuration file found. dropwizard
spring boot error statuslogger no log4j 2 configuration file found
log4j2 configuration status
log4j json configuration

When running mvn verify I am getting below message:

I already put the log4j2.xml under src/test/resources (but not in src/main/resources because I do not want it to ship with actual app) as suggested here to no avail.

The HTML report is generated, the log file is written, and the build is successful as seen above. I am unsure where the error is coming from.

According http://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration adding log4j2.xml to classpath should help.

If a JSON file cannot be located the XML ConfigurationFactory will try to locate log4j2.xml on the classpath.

So if you still get ERROR message problem not with your sources. It looks like problem in maven-cucumber-reporting plugin. As described here http://maven.apache.org/guides/mini/guide-maven-classloading.html

Please note that the plugin classloader does neither contain the dependencies of the current project nor its build output.

If maven plugin cannot find any log4j configuration in its own classpath (which is not including your sources/resources) you will see error messages. So yes, the only solution wait for release with fix https://github.com/damianszczepanik/cucumber-reporting/issues/675

Maven, You are receiving this error because cucumber or its dependencies are using log4j for logging and since there is no log4j configuration file so log4j is printing such message. Adding above configuration in /src/main/resources/log4j2. xml will have same result as having no log4j2. xml file. ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console Last Updated on May 30th, 2018 by App Shah 10 comments Maven dependencies are magic.

You use the latest Cucumber version 3.15.0 (at the time of writing this). Your problem was resolved as issue #675. There was a commit from a pull request meant to fix this problem, but probably you have to wait until the next version is released in order to profit from it - or build a snapshot version locally and see if it also fixes the problem for you.

No log4j2 configuration file found. Using default configuration , ERROR StatusLogger No log4j2 configuration file found. http://logging.apache.​org/log4j/2.0/maven-artifacts.html Log4j 1.x API Bridge If existing components  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. The report generation works. The maven project contains only test code and there is a log4j2

Run -> Run Configurations -> Classpath -> User entries -> Advanced Optiones -> Add Folders -> Then add your folder,in your case src/test/resources -> apply

It must work now :D

Solved: ERROR StatusLogger No log4j2 configuration file fo , ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property  Lately I decided to learn how to use the log4j2 logger. I downloaded required jar files, created library, xml comfiguration file and tried to use it. Unfortunately i get this statement in console (

You are receiving this error because cucumber or its dependencies are using log4j for logging and since there is no log4j configuration file so log4j is printing such message.

If there is no log4j configuration file, log4j uses configuration similar to below -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configuration>

<Configuration status="warn" name="xml_configuration">

    <Appenders>
        <Console name="consoleLogger" target="SYSTEM_OUT">
            <PatternLayout
                pattern="[%level] %m%n" />
        </Console>
    </Appenders>

    <Loggers>
        <Root level="error" additivity="false">
            <appender-ref ref="consoleLogger" />
        </Root>
    </Loggers>
</Configuration>

Adding above configuration in /src/main/resources/log4j2.xml will have same result as having no log4j2.xml file.

Another way to try is to pass log4j2.xml file to maven directly without putting it in project classpath. Something like below -

set MAVEN_OPTS="-Dlog4j.configurationFile=file:///path/to/log4j2.xml"
mvn verify

Error StatusLogger NO log4j2 configuration file found, Hello, everyone today I'll tell you how to solve the log4j error in maven which almost everyone Duration: 5:54 Posted: Sep 12, 2018 Note: this property is used by the log4j-core implementation only after a configuration file has been found. log4j2.StatusLogger.level: WARN: The initial "listenersLevel" of the StatusLogger. If StatusLogger listeners are added, the "listenerLevel" is changed to that of the most verbose listener.

according to their documentation, you can use 'joranConfigurator' and load the configuration from a specified file

documentation link

ERROR StatusLogger No log4j2 configuration file found , I read questions here and did add a log4j2.xml into src/main/resources on my maven project and i still get the same error. i also saw the elastic  ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. #221 sulthonzh opened this issue Aug 8, 2017 · 2 comments

ERROR StatusLogger No log4j2 configuration file found. Using , ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. I do have a src/main/  Log4j will inspect the "log4j.configurationFile" system property and, if set, will attempt to load the configuration using the ConfigurationFactory that matches the file extension. If no system property is set the properties ConfigurationFactory will look for log4j2-test.properties in the classpath. If no such file is found the YAML

Configuring Log4j 2 - Apache Log4j 2, If no such file is found the JSON ConfigurationFactory will look for log4j2-test.json or Note that by default Log4j assigns the root logger to Level.ERROR. ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.

No log4j2 configuration file found · Issue #225 · paypal/PayPal-Java , ERROR StatusLogger No log4j2 configuration file found. you can exclude the log4j2 dependencies using Gradle or Maven depending on  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.

Comments
  • Is it the same message if you add the following dependency in the pom -> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.10.0</version> </dependency>
  • @MrCas Still the same error message after adding log4j-api. After all, it is a transient dependency of log4j-core so it shouldn't matter whether it's specified in the pom.xml or not.
  • have you tried -Dlog4j.configurationFile=file:///path/to/your/log4j2.xml?
  • Sorry I forgot about this bounty but this is impressive detective work. Acceptable explanation and marked as answer.
  • Well, you can un-accept the other one and accept mine. My answer has been written 4 days before the accepted one and is correct. The other answer does not add value and even points to the very same ticket mine pointed to before. First come, first serve.
  • Thank you but the src/test/resources is already marked as a source folder. Everything in it already goes to the target classpath.
  • Hi, I do have the config file in the classpath. Turns out, this was a known defect in the maven-cucumber-reporting plugin itself that was not fixed until recently.
  • Thank you but this is a different logging framework.