This demo project shows the unexpected behavior of setting a log level to OFF
and messages still getting logged.
Usage:
mvn clean compile exec:java -Dexec.mainClass="nl.breun.Log4jOff"
The output will contain two log messages like these:
INFO - Foo
OFF - Foo
I did not expect a message to get logged at level OFF
.
I expected that second message to not get logged.