Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 91052 invoked from network); 6 May 2008 09:16:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 May 2008 09:16:41 -0000 Received: (qmail 64125 invoked by uid 500); 6 May 2008 09:16:41 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 64074 invoked by uid 500); 6 May 2008 09:16:41 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 64063 invoked by uid 99); 6 May 2008 09:16:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 May 2008 02:16:41 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcjgd-geronimo-dev2@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 May 2008 09:15:55 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JtJHG-00013q-Cy for dev@geronimo.apache.org; Tue, 06 May 2008 09:16:02 +0000 Received: from torino.qos.ch ([85.218.33.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 May 2008 09:16:02 +0000 Received: from ceki by torino.qos.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 May 2008 09:16:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: dev@geronimo.apache.org From: Ceki Gulcu Subject: Re: [BUILD] trunk: Failed for Revision: 653204 Date: Tue, 6 May 2008 09:15:51 +0000 (UTC) Lines: 43 Message-ID: References: <20080504143206.29555.qmail@minotaur.apache.org> <0BCCD0B8-DE93-48D1-83A2-3E3E889F7862@planet57.com> <5eb405c70805051113t71e33077mfa0b37bafa1e6724@mail.gmail.com> <452D08D9-10F3-4E53-BF1E-864E89C85419@planet57.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 85.218.33.218 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Jason Dillon writes: > > The other option, is to create our own SLF4J implementation, which > provides this serialization muck... which may also allow us to add > some ability to inject some state into the MDC and/or NDC to provide > more details about the logger, like which plugin or which ear they > came from, etc... > > --jason > > On May 6, 2008, at 1:13 AM, Jarek Gawor wrote: > > > Jason, > > > > I think we need a better solution then changing the code to have > > static loggers. There is tons of code that does > > LoggerFactory.getLogger(getClass()); and so unless we update all of > > the code to use static loggers, sooner or later this problem with > > seralization will bite us again. So I think we will need a way for a > > logger to serialize/deserlialize ok and at the same time continue to > > update the code to use static loggers. > > > > Jarek I think that Jason's proposal to inject contextual information about the logger via MDC is really very good. I'd be happy to support context injection via MDC should the need arise. Jarek's observation about tons of code using the LoggerFactory.getLogger(getClass()) idiom may be true for geronimo but is probably not true generally. The more common idiom declares loggers as static members. Moreover, keep in mind that loggers in all underlying implementations, including j.u.l, log4j and logback, are not intended to survive serialization. Thus, you may render your own implementation of SLF4J logger serializable, but I don't see how the underlying loggers would become serializable. As far as I can tell, context injection via MDC plus static loggers should meet most needs without creating complications.