Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 27116 invoked from network); 11 Aug 2010 20:17:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Aug 2010 20:17:14 -0000 Received: (qmail 2514 invoked by uid 500); 11 Aug 2010 20:17:12 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 2401 invoked by uid 500); 11 Aug 2010 20:17:12 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Delivered-To: moderator for user@commons.apache.org Received: (qmail 93492 invoked by uid 99); 11 Aug 2010 20:11:03 -0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) In-Reply-To: <4C6008F1.6070102@gmail.com> References: <4C6008F1.6070102@gmail.com> To: "Commons Users List" MIME-Version: 1.0 Subject: Re: [Logging] : Can commons.logging be used without log4j X-KeepSent: 641412C9:4CD13831-8525777C:006EB096; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5 SHF336 August 12, 2009 Message-ID: From: Jasmin Mehta Date: Wed, 11 Aug 2010 16:10:09 -0400 X-MIMETrack: Serialize by Router on NGATE1/HQ/NEXNET(Release 8.5|December 05, 2008) at 08/11/2010 04:10:10 PM, Serialize complete at 08/11/2010 04:10:10 PM Content-Type: multipart/alternative; boundary="=_alternative 006ECD098525777C_=" --=_alternative 006ECD098525777C_= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Brent, I am using log4j.properties instead of log4j.xml. Will RepositorySelector concept still work? What changes I should make into this method? private static void loadLog4JConfig(ServletConfig config, Hierarchy hierarchy) throws ServletException { try { String log4jFile = "/WEB-INF/log4j.xml"; InputStream log4JConfig = config.getServletContext().getResourceAsStream(log4jFile); Document doc = DocumentBuilderFactory.newInstance() .newDocumentBuilder() .parse(log4JConfig); DOMConfigurator conf = new DOMConfigurator(); conf.doConfigure(doc.getDocumentElement(), hierarchy); } catch (Exception e) { throw new ServletException(e); } } From: Brent Worden To: user@commons.apache.org Date: 08/09/2010 09:56 AM Subject: Re: [Logging] : Can commons.logging be used without log4j On 8/9/2010 7:53 AM, Jasmin Mehta wrote: > The log4j has limitation that if its used as a shared library then it can > initiate only one configuration. So my all we applications which shares > the same instance are populating the logs into only one log file (the web > app which deployed first in order), rather than individual / separate log > files configured in the path of each of the application's > log4j.properties. > > This isn't true. Log4j allows for defining and using multiple log configurations in a single JVM. This is accomplished by using a RepositorySelector to manage the multiple log hierarchies. See http://community.jboss.org/wiki/Log4jrepositoryselector for a web container example. Thanks, Brent Worden --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org ****************************************************************************** This email and any files transmitted with it are intended solely for the use of the individual or agency to whom they are addressed. If you have received this email in error please notify the Navy Exchange Service Command e-mail administrator. This footnote also confirms that this email message has been scanned for the presence of computer viruses. Thank You! ****************************************************************************** --=_alternative 006ECD098525777C_=--