Do you really need the packages attribute? If you have custom plugins they will normally be included in a file that is created when the annotation processor runs during compilation. If that file is present then package scanning is not required.
Ralph > On Jul 30, 2019, at 10:38 AM, Gregg Donovan <gdono...@etsy.com.INVALID> wrote: > > Hello! We noticed when profiling our server startup that log4j2's > configuration process was taking over 20 seconds. From the YourKit profile > (see below) it appears to be from scanning the classpath for JARs that may > contain plugins. We have a lot of JARs, so this takes some time, I suppose. > > Our configuration is fairly minimal. The StackdriverJsonLayout is a custom > Etsy plugin. > > <?xml version="1.0" encoding="UTF-8" ?> > <Configuration status="error" dest="error" shutdownHook="disable" > packages="com.etsy.util,org.apache.logging.log4j.core.layout"> > <Appenders><Console > name="console"><StackdriverJsonLayout/></Console></Appenders> > <Loggers><Root level="info"><AppenderRef ref="console" /></Root></Loggers> > </Configuration> > > How can we minimize log4J2 configuration time? We're open to anything, > including using Java configuration. Minimizing configuration time trumps all > other concerns. > > Thanks! > > Gregg Donovan > Staff Software Engineer, Etsy.com > > >