Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-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 9109945F5 for ; Tue, 21 Jun 2011 03:20:00 +0000 (UTC) Received: (qmail 31494 invoked by uid 500); 21 Jun 2011 03:20:00 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 31368 invoked by uid 500); 21 Jun 2011 03:19:54 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 31352 invoked by uid 99); 21 Jun 2011 03:19:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 03:19:52 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ralph.goers@dslextreme.com designates 74.125.83.175 as permitted sender) Received: from [74.125.83.175] (HELO mail-pv0-f175.google.com) (74.125.83.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 03:19:45 +0000 Received: by pvf24 with SMTP id 24so2024641pvf.34 for ; Mon, 20 Jun 2011 20:19:23 -0700 (PDT) Received: by 10.68.28.101 with SMTP id a5mr1255401pbh.309.1308626363567; Mon, 20 Jun 2011 20:19:23 -0700 (PDT) Received: from [192.168.1.69] (99-180-69-21.lightspeed.irvnca.sbcglobal.net [99.180.69.21]) by mx.google.com with ESMTPS id v6sm3438206pbh.6.2011.06.20.20.19.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2011 20:19:22 -0700 (PDT) From: Ralph Goers Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/alternative; boundary=Apple-Mail-8--393320856 Subject: Re: log4j-2.0 questions Date: Mon, 20 Jun 2011 20:19:20 -0700 In-Reply-To: <04664077-BDF4-4F97-95CE-34E75E55BBA3@seagullsoftware.com> To: "Log4J Developers List" References: <603108.40543.qm@web27801.mail.ukl.yahoo.com>, <04664077-BDF4-4F97-95CE-34E75E55BBA3@seagullsoftware.com> Message-Id: X-Mailer: Apple Mail (2.1084) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-8--393320856 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jun 20, 2011, at 5:04 PM, Gary Gregory wrote: >=20 >=20 > On Jun 20, 2011, at 17:33, "ralph.goers @dslextreme.com" = > wrote: >=20 >=20 > 2.) is there an optional support for ThreadContextClassLoader = scenarios? > This is often a problem for logging in libraries which are on a shared = classpath. Imagine 2 webapps, both using OpenWebBeans as CDI container. = One webapp sets the org.apache.webbeans loglevel to debug, the other = wone to WARN ... >=20 > As it currently stands, no, but I have always intended to introduce = something to support that. >=20 > When I wrote the Log4j 2 API it took a stab at creating an abstraction = to bind the API to an implementation. It was only when I built the core = that I added the plugin support. Looking at how it is done it now occurs = to me that the plugin support really should move to the API and be used = to bind to the implementation. This would provide the flexibility needed = to accomplish this. >=20 > How much work us that? This shouldn't be much work at all. I'll probably do it in the next few = days. The only trick is the context selection criteria and making sure = the LoggerContext and configuration are properly freed when the webapp = shuts down. Logback uses JNDI lookups (see = http://logback.qos.ch/manual/loggingSeparation.html#ContextJNDISelector) = as well as a Servlet Context Listener. I'll probably do somethnig = similar, although I'd prefer to do it with annotations. Ralph --Apple-Mail-8--393320856 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii


On Jun 20, 2011, at 17:33, "ralph.goers = @dslextreme.com" <ralph.goers@dslextreme.com<mailto:ralph.goers@dslextreme.c= om>> wrote:


2.) is there an optional support for = ThreadContextClassLoader scenarios?
This is often a problem for = logging in libraries which are on a shared classpath. Imagine 2 webapps, = both using OpenWebBeans as CDI container. One webapp sets the = org.apache.webbeans loglevel to debug, the other wone to WARN = ...

As it currently stands, no, but I have always intended to = introduce something to support that.

When I wrote the Log4j 2 API = it took a stab at creating an abstraction to bind the API to an = implementation. It was only when I built the core that I added the = plugin support. Looking at how it is done it now occurs to me that the = plugin support really should move to the API and be used to bind to the = implementation. This would provide the flexibility needed to accomplish = this.

How much work us = that?


This = shouldn't be much work at all. I'll probably do it in the next few days. =  The only trick is the context selection criteria and making sure = the LoggerContext and configuration are properly freed when the webapp = shuts down. Logback uses JNDI lookups (see http://logback.qos.ch/manual/loggingSeparation.html#ContextJNDISele= ctor) as well as a Servlet Context Listener. I'll probably do = somethnig similar, although I'd prefer to do it with = annotations.

Ralph

= --Apple-Mail-8--393320856--