Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E3553200D23 for ; Thu, 5 Oct 2017 05:56:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E1B14160BD7; Thu, 5 Oct 2017 03:56:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2EB651609DD for ; Thu, 5 Oct 2017 05:56:52 +0200 (CEST) Received: (qmail 10313 invoked by uid 500); 5 Oct 2017 03:56:51 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 10302 invoked by uid 99); 5 Oct 2017 03:56:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Oct 2017 03:56:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 35B3C1A1FF2 for ; Thu, 5 Oct 2017 03:56:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id oLJINmOjtDLG for ; Thu, 5 Oct 2017 03:56:48 +0000 (UTC) Received: from smtp618.redcondor.net (smtp618.redcondor.net [208.80.206.18]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 789935FDEA for ; Thu, 5 Oct 2017 03:56:48 +0000 (UTC) Received: from mailproxy12.neonova.net ([137.118.22.77]) by smtp618.redcondor.net ({25934d7d-0c4d-4838-a484-2a3cc0768185}) via TCP (outbound) with ESMTP id 20171005035641328_0618 for ; Thu, 05 Oct 2017 03:56:41 +0000 X-RC-FROM: X-RC-RCPT: Received: from [192.168.1.3] (ip72-201-73-113.ph.ph.cox.net [72.201.73.113]) (Authenticated sender: ralph.goers@dslextreme.com) by mailproxy12.neonova.net (Postfix) with ESMTPA id F15693602A5 for ; Wed, 4 Oct 2017 23:56:37 -0400 (EDT) From: Ralph Goers Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: loggerContext for container shared lib Date: Wed, 4 Oct 2017 20:56:36 -0700 References: To: Log4J Users List In-Reply-To: Message-Id: <2CA8C0EC-BB67-411D-8FBC-1458B0A3920B@dslextreme.com> X-Mailer: Apple Mail (2.3273) X-DLP-OUTBOUND: 137.118.22.64/27 X-MAG-OUTBOUND: greymail.redcondor.net@137.118.22.64/27 archived-at: Thu, 05 Oct 2017 03:56:53 -0000 You didn=E2=80=99t say if you also have a log4j2.xml file in tomcat/lib. = If you log something before the two web apps start I am certain that it = would use the log4j2.xml in tomcat/lib. I will have to look at the code = that loads the configuration file to determine which ClassLoader it will = use when the call is made from a web app. If it uses the thread context = class loader then that could cause the problem. Ralph > On Oct 4, 2017, at 3:13 PM, billokara@gmail.com wrote: >=20 > Hi, >=20 > we have multiple webapps, say, webapp1 and webapp2, that use a shared = apache lib (say commonLib, which also uses log4j logging) that deployed = as jndi resource in tomcat (thus was put in tomcat/lib), and followings = are our log4j jars deploy location: >=20 > tomcat/lib: > - log4j-core.jar, log4j-api.jar > - commonLib.jar >=20 > webapp1 and webapp2, in /WEB-INF: > - classes/log4j2.xml > - lib/log4j2-web.jar >=20 > When loading, the ClassLoaderContextSelector correctly uses the = webappClassloader to load the log4j config for webapp1 and webapp2. But = for the commonLib loggerContext, depending on which webapp got loaded = first, the commonLib loggerContext will either be using=20 > webapp1/WEB-INF/classes/log4j2.xml > or=20 > webapp2/WEB-INF/classes/log4j2.xml >=20 > This poses the problem that if say the commonLib loggerContext is = using=20 > webapp1/WEB-INF/classes/log4j2.xml >=20 > then webapp1 got undeployed, then the commonLib loggerContext will be = referencing a no longer existed config file. >=20 > any advise on how to handle or resolve the config issue for shared lib = loggerContext that uses log4j? >=20 >=20 > Thanks! > Bill >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org