Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 87599 invoked from network); 27 Oct 2009 17:16:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 17:16:48 -0000 Received: (qmail 64677 invoked by uid 500); 27 Oct 2009 17:16:48 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 64620 invoked by uid 500); 27 Oct 2009 17:16:48 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 64610 invoked by uid 99); 27 Oct 2009 17:16:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 17:16:48 +0000 X-ASF-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.40.44.233] (HELO smtprelay.hostedemail.com) (216.40.44.233) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 17:16:45 +0000 Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay03.hostedemail.com (Postfix) with SMTP id 13B68144C982 for ; Tue, 27 Oct 2009 17:16:24 +0000 (UTC) X-Spam-Summary: 50,0,0,08ac270a6920a5b7,907452bc8cfe1759,dkulp@apache.org,dev@cxf.apache.org:bimargulies@gmail.com,RULES_HIT:355:379:599:601:945:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1766:1792:2393:2525:2553:2561:2564:2682:2685:2828:2857:2859:2895:2898:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3355:3865:3866:3867:3868:3869:3870:3871:3872:3874:3876:3877:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6114:6117:6119:6120:6261:7679:7901:7903:8501:8957:8985:9025:9388,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fu,MSBL:none,DNSBL:none X-Session-Marker: 64616E406B756C702E636F6D X-Filterd-Recvd-Size: 3952 Received: from server.dankulp.com (server1.dankulp.com [66.207.172.168]) (Authenticated sender: dan@kulp.com) by omf04.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2009 17:16:23 +0000 (UTC) Received: by server.dankulp.com (Postfix, from userid 5000) id 5C0CF507001D; Tue, 27 Oct 2009 13:16:23 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.1-gr1 (2007-05-02) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter.COFVWq546Q Received: from dilbert.localnet (c-24-91-141-225.hsd1.ma.comcast.net [24.91.141.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTPSA id 6C5F15070016; Tue, 27 Oct 2009 13:16:19 -0400 (EDT) From: Daniel Kulp To: dev@cxf.apache.org Subject: Re: CXF logging.... Date: Tue, 27 Oct 2009 13:16:04 -0400 User-Agent: KMail/1.12.2 (Linux/2.6.31-gentoo-r3; KDE/4.3.2; x86_64; ; ) Cc: Benson Margulies References: <200910271154.52959.dkulp@apache.org> <61b5d9410910271010j43fe38e4p847f806014b926d3@mail.gmail.com> In-Reply-To: <61b5d9410910271010j43fe38e4p847f806014b926d3@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200910271316.05115.dkulp@apache.org> X-Old-Spam-Status: No, score=-3.4 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.1-gr1 On Tue October 27 2009 1:10:36 pm Benson Margulies wrote: > Why not just switch to sfl4j, defaulting to the j.u.l module? Cause that's a TON of work. All logging in CXF would need to change. Plus, SLF4J is not i18n enabled at all. Thus, all the places we use the Message.properties files for logging messages would need to be updated to handle the i18n stuff themselves instead of letting the logger do it. We could wrapper a SLF4J logger with a j.u.l Logger API like we do for Log4J, but that seems kind of silly to do j.u.l -> SLF4J -> j.u.l. Dan > > On Tue, Oct 27, 2009 at 11:54 AM, Daniel Kulp wrote: > > As everyone is probably aware, CXF uses the j.u.l API for all of it's > > logging. > > That's really not likely to change, but we do allow logging to Log4J by > > setting some system properties or a file in META-INF/cxf. > > > > However, I was thinking it might make sense to try and detect where > > SLF4J is > > logging and if it's logging to Log4J, we should as well. The > > reflection code to do that isn't very complex: > > > > Class.forName("org/slf4j/impl/StaticLoggerBinder"); > > Class cls = Class.forName("org.slf4j.LoggerFactory"); > > Class fcls = > > cls.getMethod("getILoggerFactory").invoke(null).getClass(); if > > (fcls.getName().contains("Log4j")) { > > cname = "org.apache.cxf.common.logging.Log4jLogger"; > > } else if (fcls.getName().contains("JCL")) { > > cls = Class.forName("org.apache.commons.logging.LogFactory"); > > fcls = cls.getMethod("getFactory").invoke(null).getClass(); > > if (fcls.getName().contains("Log4j")) { > > cname = "org.apache.cxf.common.logging.Log4jLogger"; > > } > > } > > > > What are peoples thoughts on doing that? That way, if SLF4J is logging > > to Log4J, or if SLF4J is logging to JCL which is logging to Log4J, we > > would log > > to Log4J as well. If SLF4J is logging to someplace else, we'd still > > log to > > j.u.l so that wouldn't change. > > > > One note: with PAX logging in servicemix/felix, the ILoggerFactory would > > not > > contain "Log4j". Thus, we'd continue to use j.u.l. But that is OK as > > PAX logging already interceptor j.u.l and directs them to the same place. > > > > Thoughts? Comments? > > > > -- > > Daniel Kulp > > dkulp@apache.org > > http://www.dankulp.com/blog > -- Daniel Kulp dkulp@apache.org http://www.dankulp.com/blog