How to get different log level for logfile and console?

    <Logger name="com.example" level="debug">
        <AppenderRef ref="File"/>
    <Root level="info">
        <AppenderRef ref="Console"/>

This outputs log level debug to both Console and File. I tried reversing the order and, although I think it does something else, adding additivity="false" to Logger. Both didn’t give me the expected result.

Where am I going wrong?


You can choose the log level with the AppenderRef tag.

    <Root level="trace">
        <AppenderRef ref="Console" level="info"/>
        <AppenderRef ref="File" level="debug"/>

Thanks to andrewjames for pointing to the relevant FAQ entry.