Hi Joakim,
everything you said is 100% true, unfortunately but I think you don't understand what I'm trying to do.
YOU: "For your setup you have a mystery artifact org.apache.logging.log4j:
log4j-slf4j-impl:${log4j.version} no idea what that one does."
It provides (just as you guessed) a binding to slf4j so that all slf4j logs will be routed to log4j2 and then to the disk.
Also
YOU: "... that means you have slf4j-simple.jar in your classpath. Remove that artifact from your classpath."
is exactly what I'm trying to do:
ME: "I believe that someone (jetty, maven, plexus, jetty-maven-plugin) is dragging the slf4j's simple logger in the classpath,
which overrides the log4j2's simplelogger. Unfortunately I can't find out which one."
I tried mvn dependency:tree but this artifact is nowhere in the dependency tree. Unfortunately the mvn dependency:tree resolved only the dependencies in the pom, so my guess is that maybe the jetty-maven-plugin or maven itself or plexus is dragging that artifact.
And finally
YOU: "Also note, there's no such thing as "log4j2's simplelogger""
Unfortunately there is. If you open the jar if log4j-slf4j-impl you will see there the class org.slf4j.impl.SLF4JLogger which implements the Logger from slf4j-api.
Could someone point into a direction how to create jetty logger for log4j2?
Thanks a lot.