Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9D3F5E0B2 for ; Sat, 2 Feb 2013 20:56:25 +0000 (UTC) Received: (qmail 58658 invoked by uid 500); 2 Feb 2013 20:56:24 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 58595 invoked by uid 500); 2 Feb 2013 20:56:24 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 58586 invoked by uid 99); 2 Feb 2013 20:56:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2013 20:56:24 +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.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2013 20:56:22 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 302285A6; Sat, 2 Feb 2013 20:56:01 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Sat, 02 Feb 2013 20:56:01 -0000 Message-ID: <20130202205601.40311.23419@eos.apache.org> Subject: =?utf-8?q?=5BTomcat_Wiki=5D_Update_of_=22HowTo=22_by_KonstantinKolinko?= Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for ch= ange notification. The "HowTo" page has been changed by KonstantinKolinko: http://wiki.apache.org/tomcat/HowTo?action=3Ddiff&rev1=3D120&rev2=3D121 Comment: Remove "How do I use log4j for all Tomcat log output?" entry. The text was = old and wrong. This topic is covered by Tomcat docs. No. If you can edit Tomcat's startup scripts (or better create a {{{sete= nv.sh}}} file), you can add "-D" options to Java. But there is no way in J= ava to have different values of system properties for different classes in = the same JVM. = There are some other methods available, like using {{{ServletContext.getC= ontextPath()}}} to get the context name of your web application and locate = some resources accordingly, or to define {{{}}} elements in = {{{WEB-INF/web.xml}}} file of your web application and then set the values = for them in Tomcat context file ({{{META-INF/context.xml}}}). See http://to= mcat.apache.org/tomcat-7.0-doc/config/context.html . - = - =3D=3D How do I use log4j for all Tomcat log output? =3D=3D - To have Tomcat use log4j universally, place both `log4j.jar` and the Jaka= rta `commons-logging.jar` into the `$TOMCAT_HOME/common/lib` directory. Cr= eate your log4j properties file as `$TOMCAT_HOME/common/classes/log4j.prope= rties` and configure the root logger. Here is the basic `log4j.properties`= that I used to do this myself: - = - {{{ - log4j.rootLogger=3Dinfo, R - log4j.appender.R=3Dorg.apache.log4j.ConsoleAppender - log4j.appender.R.layout=3Dorg.apache.log4j.PatternLayout - log4j.appender.R.layout.ConversionPattern=3D%-5p %-30.30c{1} %x - %m%n - }}} - If you only need to use log4j in your own web app, just include log4j (an= d any log4j properties file) in your WAR file. = =3D=3D How do I configure Tomcat Connectors? =3D=3D On the Tomcat FAQ, there is a list of Other Resources which should have i= nformation pointing you to the relevant pages. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org