Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 60114 invoked from network); 18 Jun 2010 18:45:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Jun 2010 18:45:49 -0000 Received: (qmail 39443 invoked by uid 500); 18 Jun 2010 18:45:48 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 39391 invoked by uid 500); 18 Jun 2010 18:45:47 -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 39382 invoked by uid 99); 18 Jun 2010 18:45:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 18:45:47 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.208.4.194] (HELO mout.perfora.net) (74.208.4.194) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 18:45:40 +0000 Received: from winxedgeus02.exchange.xchg (winxedgeus02.lxa.perfora.net [172.23.130.34]) by mrelay.perfora.net (node=mrus3) with ESMTP (Nemesis) id 0LcSFC-1P83OC29u2-00jp9D; Fri, 18 Jun 2010 14:45:18 -0400 Received: from winxhubus04.exchange.xchg (172.23.130.36) by winxedgeus02.exchange.xchg (172.23.130.34) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 18 Jun 2010 14:45:18 -0400 Received: from winxbeus13.exchange.xchg ([172.23.130.73]) by winxhubus04.exchange.xchg ([172.23.130.36]) with mapi; Fri, 18 Jun 2010 14:45:15 -0400 From: dB. To: "dev@tomcat.apache.org" Date: Fri, 18 Jun 2010 14:45:15 -0400 Subject: How can I fetch the web application (context) at runtime? Thread-Topic: How can I fetch the web application (context) at runtime? Thread-Index: AcsPFmP6OPCq1jAeQJGhAJ3W4HXkeg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US x-provags-id: V01U2FsdGVkX19V7QZ5+rk8FH4kV0+cZEm/Z6pltznGrex+BA3 aFKnqTWwRq669srm2I3seJ2RLqdL0FTiEtxlE9E3ap2un/L8X Content-Type: multipart/alternative; boundary="_000_AF5EF1769D564645A9ACC947375F0D0215848175F8winxbeus13exc_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_AF5EF1769D564645A9ACC947375F0D0215848175F8winxbeus13exc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am trying to write a log4j appender that can put the application name in = the log filename (I want a log per web application, without knowing the nam= es of all the web applications upfront). Is there a way to access the context / container / some variable that can g= ive me the name of the web application (or something else unique per web ap= plication) at runtime from a far-reaching piece of code? I'd be happy with = a solution that works only with a specific version of Tomcat (6). Thx dB. dB. @ dblock.org Moscow|Geneva|Seattle|New York --_000_AF5EF1769D564645A9ACC947375F0D0215848175F8winxbeus13exc_--