Import into your pom.xml the following xml part.
<dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.9.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.9.1</version> </dependency> </dependencies>
create the configuration file configuration.xml
<?xml version="1.0" encoding="UTF-8"?> <Configuration> <Appenders> <Console name="Console"> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> </Console> </Appenders> <Loggers> <Root level="trace"> <AppenderRef ref="Console"/> </Root> </Loggers> </Configuration>
use it
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; class ..... final static Logger log = LogManager.getLogger(PrototypeFolderNavigation.class);