No, that is not correct.
Any events with a level of WARN
or more specific (ERROR
or FATAL
) that are sent to the "com.example.Section" logger will be accepted by that logger and sent to its appenders. Since additivity is false
for this logger events are not sent to any appenders of its ancestors.
Any events with a level of INFO
or more specific (WARN
, ERROR
, FATAL
) sent to the logger "com.example.Section2" will be accepted by that logger and sent to its appenders. Since additivity is true
by default events accepted by this logger will go to the appenders of its ancestors as well, which would only be those of the root logger.
Any events that go to the root logger will be accepted and sent to its appenders regardless of log level since its level is set to ALL
. As this is the root logger additivity does nothing, there are no ancestors of this logger.
The log4j2 manual has examples and explanations of additivity that can help you understand this as well. There are some other questions on stackoverflow about additivity that may also be helpful.