From commits-return-1106-apmail-logging-commits-archive=logging.apache.org@logging.apache.org Fri Aug 24 05:00:10 2012 Return-Path: X-Original-To: apmail-logging-commits-archive@minotaur.apache.org Delivered-To: apmail-logging-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EBE00DC01 for ; Fri, 24 Aug 2012 05:00:09 +0000 (UTC) Received: (qmail 45551 invoked by uid 500); 24 Aug 2012 05:00:09 -0000 Delivered-To: apmail-logging-commits-archive@logging.apache.org Received: (qmail 45481 invoked by uid 500); 24 Aug 2012 05:00:07 -0000 Mailing-List: contact commits-help@logging.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@logging.apache.org Delivered-To: mailing list commits@logging.apache.org Received: (qmail 45447 invoked by uid 99); 24 Aug 2012 05:00:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2012 05:00:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2012 05:00:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BE7FD23888FD; Fri, 24 Aug 2012 04:59:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1376825 - /logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml Date: Fri, 24 Aug 2012 04:59:22 -0000 To: commits@logging.apache.org From: rgoers@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120824045922.BE7FD23888FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rgoers Date: Fri Aug 24 04:59:22 2012 New Revision: 1376825 URL: http://svn.apache.org/viewvc?rev=1376825&view=rev Log: Document invoking the PluginManager during a build. Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml?rev=1376825&r1=1376824&r2=1376825&view=diff ============================================================================== --- logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml (original) +++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml Fri Aug 24 04:59:22 2012 @@ -100,6 +100,38 @@ key is the name of the item to locate.

+ + + Scanning for annotated classes dynamically takes a bit of time during application initialization. Log4j + avoids this by scanning its classes during the build. In the Maven build, the PluginManager is invoked as + shown below and then the resulting Map is stored in a file in the jar being constructed. Log4j will locate + all the files created this way and and preload them, which shortens startup time considerably. Adding the + following plugin definition to your project's pom.xml will cause the plugin manager to be called during the + build. It will store the resulting file in the correct location under the directory specified in the first + argument after scanning all the components located under the package specified in the second argument. + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + process-classes + + java + + + + + org.apache.logging.log4j.core.config.plugins.PluginManager + + ${project.build.outputDirectory} + org.myorg.myproject.log4j + + + + ]]> +