So I\'m trying to learn log4j2 and wrap my head around the loggers and their levels and parental propagation.
Currently my source hierarchy runs is:
├──
The issue you're having is due to additivity being true
by default. Your tutorial is misleading in that it says:
By default log4j2 logging is additive. It means that all the parent loggers will also be used when a specific logger is used.
In fact it does not mean that all parent loggers will be used, it means all of the appenders of parent loggers will be used. You should read the log4j2 manual, particularly the section on additivity.
In the additivity section of the manual, there is an example with some explanation after it:
Notice that the trace messages from com.foo.Bar appear twice. This is because the appender associated with logger com.foo.Bar is first used, which writes the first instance to the Console. Next, the parent of com.foo.Bar, which in this case is the root logger, is referenced. The event is then passed to its appender, which also writes to the Console, resulting in the second instance. This is known as additivity.
With additivity set to true
(as it is by default) any event accepted by a child logger is passed to the appenders of all parent loggers.