This question is the same question as this question (But for log4j2): log4j: abbreviate/shorten package names
This is quite simple and is documented at http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout. In your patternLayout just specify %c{1.} in the pattern to get the abbreviated Logger name. If you want the class name instead, use %C{1.}.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With