I put a dependency of log4j in pom.xml file:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.10.0</version>
</dependency>
wrote the following log4j.properties file:
log4j.rootLogger=INFO, stdout, console log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
and put this file under 'resources' folder.
Lastly, I put environment variable LOG4J_log4j.configurationFile = log4j.properties
Still, when I run my application, the line:
logger.info("Hello");
does not write anything to console. Do you know what can be the problem?