1

I am trying to disable the logging of a package for certain appenders, but I still have them logged everything else.

I have tried:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Appenders>
        <Console name="console">
        </Console>
        <RollingFile name="files">
        </RollingFile>
    </Appenders>

    <category name="org.springframework.beans">
        <priority value="info" />
    </category>

    <Loggers>

        <Logger name="my.package.to.disable.log" level="off">
            <AppenderRef ref="console" />
        </Logger>

        <Root level="info" additivity="false">
            <AppenderRef ref="console" />
            <AppenderRef ref="files" />
        </Root>
    </Loggers>
</Configuration>

This disables my package logs in both appenders. How could I prevent this?

taylor.2317
  • 582
  • 1
  • 9
  • 23
Illidan
  • 149
  • 1
  • 8
  • Check this question: [What is the result of making log4j additivity equals to true or false?](https://stackoverflow.com/q/22692097/11748454) – Piotr P. Karwasz Feb 04 '22 at 04:17

0 Answers0