Indonesia Website Awards
Indonesia Website Awards

When running tests with JMeter I get an error message ERROR StatusLogger No log4j2 configuration file found so that the test I tried couldn’t be done. After I found out the cause, it turned out that there wasn’t any configuration in the log4j2.xml file and after I filled in the configuration in the file the problem was solved. Here are the steps for How to Fix ERROR log4j2 on JMeter:

Step 1 – Go to the bin folder in Apache JMeter

cd apache-jmeter-5.4.1/bin/

*here I am using JMeter version 5.4.1

Step 2 – Find and open the log4j2.xml file with your favorite editor

find ./ -name 'log4j2.xml'

vim log4j2.xml

how to fix error log4j2

Step 3 – Enter the following configuration
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>

    <Properties>
        <Property name="path">target</Property>
        <Property name="logFileName">integration-tests-logs</Property>
        <Property name="logPattern">%d{HH:mm:ss,SSS} %-5.5p %28.28c{2}| %m%n</Property>
    </Properties>

    <Appenders>
        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout pattern="${logPattern}"/>
        </Console>
        <File name="logfile" fileName="${path}/${logFileName}.log" append="true">
            <PatternLayout pattern="${logPattern}"/>
        </File>
    </Appenders>

    <Loggers>
        <Root level="DEBUG">
            <AppenderRef ref="console"/>
            <AppenderRef ref="logfile"/>
        </Root>
        <Logger name="org.eclipse.jetty" level="INFO" additivity="false">
            <AppenderRef ref="console"/>
        </Logger>
    </Loggers>
</Configuration>

This configuration configures logging in the console and generates a log file in the target folder every time you run a test with JMeter. After you save the configuration, try running the JMeter test again and the error message should no longer appear.

 

Also Read: How to Install JMeter on Ubuntu 20.04

 

Yes, that’s how to fix error log4j2 on JMeter that I can share. I hope this information is helpful. Thank you ^^,

 

SOURCE : stackoverflow.com

 

Categories: Troubleshoot

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *