We have migrated a few days back from log4j 1.x to log4j 2.x. But I am unable to migrate log4j.properties to log4j2.properties.
Earlier we had the file named log4j.properties in classpath with the below contents:
log4j.rootLogger = INFO, out, FILE
log4j.appender.out=org.apache.log4j.ConsoleAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %c{1}:%L - %m%n
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.File=logPath/logName.log
log4j.appender.FILE.DatePattern='.'yyyy-MM-dd
log4j.appender.FILE.MaxFileSize=200MB
log4j.appender.FILE.MaxBackupIndex=20
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %c{1}:%L - %m%n
It used to work perfectly fine. Now I have deleted the file and created a file named log4j2.properties with the below content:
rootLogger = INFO, out, FILE
appender.out.type=Console
appender.out.layout.type=PatternLayout
appender.out.layout.pattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %c{1}:%L - %m%n
appender.FILE.type=RollingFile
appender.FILE.name=RollingFile
appender.FILE.append=true
appender.FILE.fileName=logPath/logName.log
appender.FILE.filePattern='.'yyyy-MM-dd
appender.FILE.policies.type = Policies
appender.FILE.policies.time.type = TimeBasedTriggeringPolicy
appender.FILE.policies.time.interval = 1
appender.FILE.policies.time.modulate = true
appender.FILE.policies.size.type = SizeBasedTriggeringPolicy
appender.FILE.policies.size.size=100MB
appender.FILE.strategy.type = DefaultRolloverStrategy
appender.FILE.strategy.max = 1
appender.FILE.layout.type=PatternLayout
appender.FILE.layout.pattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %c{1}:%L - %m%n
I am trying to achieve the same functionality but it is not logging anything to the log file. Can you please suggest what I am doing wrong? The project is a Spring Boot Project.