Migrating from log4j to log4j2 - properties file configuration
You can use this to convert from Log4J.properties (v1.2) to log4j2.xml as below:
1) Convert from v1.2 properties to v1.2XML using this converter: https://log4j-props2xml.appspot.com/
2) Convert from v1.2 XML to v2.0 XML (i.e. Log4j2.xml) using the procedure provided on this link: https://logging.apache.org/log4j/2.x/manual/migration.html
Here is what I constructed after going through the documentation and worked.
rootLogger.level = INFO
property.filename = trace.log
appenders = R, console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d %5p [%t] (%F:%L) - %m%n
appender.R.type = RollingFile
appender.R.name = File
appender.R.fileName = ${filename}
appender.R.filePattern = ${filename}.%d{yyyy-MM-dd}
appender.R.layout.type = PatternLayout
appender.R.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
appender.R.policies.type = Policies
appender.R.policies.time.type = TimeBasedTriggeringPolicy
appender.R.policies.time.interval = 1
rootLogger.appenderRefs = R, console
rootLogger.appenderRef.console.ref = STDOUT
rootLogger.appenderRef.R.ref = File