Follow-up to earlier post, adjusted for log4j version 2, this time in XML configuration:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">

  ...
  
    <Loggers>
        <Root level="${sys:log4j.logLevel:-INFO}">
            <appender-ref ref="DailyRollingFile"/>
        </Root>
    </Loggers>
  
</Configuration>