From adffaces-issues-return-2540-apmail-incubator-adffaces-issues-archive=incubator.apache.org@incubator.apache.org Mon May 07 16:52:37 2007 Return-Path: Delivered-To: apmail-incubator-adffaces-issues-archive@locus.apache.org Received: (qmail 9506 invoked from network); 7 May 2007 16:52:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2007 16:52:37 -0000 Received: (qmail 5349 invoked by uid 500); 7 May 2007 16:52:43 -0000 Delivered-To: apmail-incubator-adffaces-issues-archive@incubator.apache.org Received: (qmail 5335 invoked by uid 500); 7 May 2007 16:52:43 -0000 Mailing-List: contact adffaces-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-issues@incubator.apache.org Delivered-To: mailing list adffaces-issues@incubator.apache.org Received: (qmail 5326 invoked by uid 99); 7 May 2007 16:52:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 09:52:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 09:52:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A435E71406B for ; Mon, 7 May 2007 09:52:15 -0700 (PDT) Message-ID: <17799010.1178556735670.JavaMail.jira@brutus> Date: Mon, 7 May 2007 09:52:15 -0700 (PDT) From: "jijun wang (JIRA)" To: adffaces-issues@incubator.apache.org Subject: [jira] Updated: (ADFFACES-441) Adding localization to logging message and exception In-Reply-To: <20912646.1175800292720.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] jijun wang updated ADFFACES-441: -------------------------------- Attachment: trinidadexc1a.patch For review only. Change on exception part. Check TrinidadLogger.java, FastMessageFormat.java New files not included. > Adding localization to logging message and exception > ---------------------------------------------------- > > Key: ADFFACES-441 > URL: https://issues.apache.org/jira/browse/ADFFACES-441 > Project: MyFaces ADF-Faces > Issue Type: Improvement > Components: Components > Affects Versions: 1.0.1-incubating-core-SNAPSHOT > Environment: Generic > Reporter: jijun wang > Assigned To: Jeanne Waldman > Fix For: 1.0.1-incubating-core-SNAPSHOT > > Attachments: trinidad.zip, trinidad2.zip, trinidad2b.zip, trinidad3a.zip, trinidad3b.zip, trinidadexc1a.patch > > > Proposal: > 1) use resource bundle for logging message in java files above fine level so those message could be localized; > 2) localize part/all exception in java files with resource bundle > Benefit: > More information in local language accessible for people in tech support, operation, deployment, field application etc whose software uses trinidad code > Details: > Trinidad-api and trinidad-impl will have their own LoggerBundle.xrts where message to be localized is defined. A LoggerUtils class will be added as a decorator in each project. LoggerUtils.createTrinidadLogger will return a TrinidadLogger instance with appropriate resource bundle attached. Message localization in logging is thus available from java logging by inheritance. Localization in exception message is achieved by passing localized message to exception. For both logging and exception, server locale will be used. This might create inconsistency for exception when client locale and server locale are different. Since an exception not captured would show both on server logger and client browser, using server locale is more practical. > Open Issues: > 1) Current API in TrinidadLogger is not enough to handle logging that contains message, message parameters and throwable. e.g > _LOG.warning("Unable to instantiate converterClass:" + converterName, e); would become: > _LOG.warning("UNABLE_INSTANTIATE_CONVERTERCLASS", converterName, e); or > _LOG.logp(Level.WARNING, ..."UNABLE_INSTANTIATE_CONVERTERCLASS", converterName, e) > But we neither warning() nor logp() has API that would take (...String message, Object parm, throwable e) as signature. Should we add API or use 2 logging statements? > _LOG.warning("Unable to instantiate converterClass:" + converterName; > _LOG.warning(e); > 2) Should LoggerUtils provide some methods like public static String getMessage(TrinidadLogger logger, String key (, Object params([])?)?) to retrieve localized string from resource bundle(parameter substitution could also be done in the method). The alternative is to use TrinidadLogger.getResourceBundle.getString(key) to retrieve localized message(in this case no parameter substitution or we don't localize exception message that carries parameters) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.