In Log4j2, you can use %c{2} to _include_ the rightmost 2 packages. See the
docs you point to...Gary On Thu, Dec 3, 2015 at 4:11 AM, Schudt, Christian <[email protected]> wrote: > Hello, > > log4j 1 has the possibiliy to specify a negative precision for the logger > name in the pattern, e.g.: > > c{-4} > > which meant, that the 4 left most package names were excluded. > > E.g. "org.apache.logging.log4j.core.LogEvent" becomes "core.LogEvent" > > In Log4j2, this pattern results in: > > "-.-.-.-.core.LogEvent" > > How can I achieve the log4j 1 behavior, i.e. excluded the first X package > names? > > Thanks, > Christian > > Related documentation: > http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout > -- E-Mail: [email protected] | [email protected] Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory
