Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

log4j2: Abbreviate / shorten package names

Tags:

java

log4j2

This question is the same question as this question (But for log4j2): log4j: abbreviate/shorten package names

like image 841
Ole Avatar asked Jul 08 '16 17:07

Ole


1 Answers

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.}.

like image 132
rgoers Avatar answered Sep 21 '22 12:09

rgoers