Return-Path: X-Original-To: apmail-aries-dev-archive@www.apache.org Delivered-To: apmail-aries-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 96C5C9BE3 for ; Fri, 2 Mar 2012 10:24:59 +0000 (UTC) Received: (qmail 20914 invoked by uid 500); 2 Mar 2012 10:24:59 -0000 Delivered-To: apmail-aries-dev-archive@aries.apache.org Received: (qmail 20887 invoked by uid 500); 2 Mar 2012 10:24:59 -0000 Mailing-List: contact dev-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list dev@aries.apache.org Received: (qmail 20878 invoked by uid 99); 2 Mar 2012 10:24:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 10:24:59 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fmeschbe@adobe.com designates 64.18.1.31 as permitted sender) Received: from [64.18.1.31] (HELO exprod6og113.obsmtp.com) (64.18.1.31) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 Mar 2012 10:24:51 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob113.postini.com ([64.18.5.12]) with SMTP ID DSNKT1Cf3RnrDRYGbUOo3xFYsddd0dGgm2eq@postini.com; Fri, 02 Mar 2012 02:24:30 PST Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q22AMRJ0002130 for ; Fri, 2 Mar 2012 02:22:28 -0800 (PST) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q22AOQPl005425 for ; Fri, 2 Mar 2012 02:24:26 -0800 (PST) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas03.corp.adobe.com (10.8.189.121) with Microsoft SMTP Server (TLS) id 8.3.192.1; Fri, 2 Mar 2012 02:24:26 -0800 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurhub01.eur.adobe.com ([10.128.4.30]) with mapi; Fri, 2 Mar 2012 10:24:24 +0000 From: Felix Meschberger To: "dev@aries.apache.org" Date: Fri, 2 Mar 2012 10:24:24 +0000 Subject: Re: JNDI log messages Thread-Topic: JNDI log messages Thread-Index: Acz4XkHIJ3UIFxIqQsqnW5VygMbKngAAGGzY Message-ID: <6afuov0xc65prl24hldx2iri.1330683860472@email.android.com> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org When you run embedded in an app server the factory tends to be set ... Regards Felix Guillaume Nodet schrieb: Isn't that a real problem if the factory is already set ? Or is that a valid use case ? On Fri, Mar 2, 2012 at 10:52, David Bosschaert wrote: > Another email about logging ... > > During the integration of the Aries JNDI component in our project we > hit an issue with the log messages emitted from > > https://svn.apache.org/repos/asf/aries/trunk/jndi/jndi-core/src/main/java= /org/apache/aries/jndi/startup/Activator.java > > Specifically the following block (there is a second block just like > this one too): > > try { > OSGiInitialContextFactoryBuilder builder =3D new > OSGiInitialContextFactoryBuilder(); > NamingManager.setInitialContextFactoryBuilder(builder); > icfBuilder =3D builder; > } catch (NamingException e) { > LOGGER.info(Utils.MESSAGES.getMessage("unable.to.set.static.ICFB"), e); > } catch (IllegalStateException e) { > > LOGGER.info(Utils.MESSAGES.getMessage("unable.to.set.static.ICFB.already= .exists", > getClassName(InitialContextFactoryBuilder.class)), e); > } > > In our case the InitialContextFactoryBuilder is already set, so there > will be an IllegalStateException, but this is totally harmless in our > case. It's fine to log an INFO message, but we don't want the > exception to appear at this level, as that gets people worried, > therefore, would it be acceptable to change the log message to > something like this? > > > LOGGER.info(Utils.MESSAGES.getMessage("unable.to.set.static.ICFB.already= .exists", > getClassName(InitialContextFactoryBuilder.class))); > > LOGGER.debug(Utils.MESSAGES.getMessage("unable.to.set.static.ICFB.alread= y.exists", > getClassName(InitialContextFactoryBuilder.class)), e); > > So that the message is still logged at debug level but the exception > only appear at Debug level? > > Thanks, > > David > -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ FuseSource, Integration everywhere http://fusesource.com