You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-issues@incubator.apache.org by "jijun wang (JIRA)" <ad...@incubator.apache.org> on 2007/04/05 19:11:32 UTC
[jira] Created: (ADFFACES-441) Adding localization to logging
message and exception
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
Environment: Generic
Reporter: jijun wang
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. Could we add needed API?
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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidad.zip
The change is based on rev 525249 on trunk.
This is for your review only. Please do not apply. Some committee member at Oracle will deliver this change.
Localized most logging message(done by script. The remaining will be done manually later). Exception message localization will be done later.
> 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
> Attachments: trinidad.zip
>
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidadexc2b.patch
patch to localize exception string based on 536365(part 2 of 2: newly added files)
> 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, trinidadexc1b.patch, trinidadexc2a.patch, trinidadexc2b.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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "Matthias Weßendorf (JIRA)" <ad...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthias Weßendorf updated ADFFACES-441:
----------------------------------------
Affects Version/s: 1.0.1-incubating-core-SNAPSHOT
> 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
>
> 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.
[jira] Commented: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "Adam Winer (JIRA)" <ad...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489843 ]
Adam Winer commented on ADFFACES-441:
-------------------------------------
(1) I'd say use 2 logging statements.
(2) I don't think we need a LoggerUtils class - we should just be able to get away with enhancing TrinidadLogger to mix in the resource bundle automatically. And then I'd add a non-static getBundleMessage() to TrinidadLogger.
> 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
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidadexc2a.patch
patch to localize exception string based on 536365(part 1 of 2: updated files)
> 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, trinidadexc1b.patch, trinidadexc2a.patch, trinidadexc2b.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.
[jira] Commented: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "Jeanne Waldman (JIRA)" <ad...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492153 ]
Jeanne Waldman commented on ADFFACES-441:
-----------------------------------------
I committed patch 3a and 3b for Jijun. I had to have Jijun give me 2 of the new files (.xrts and .dtd file) since I had problems patching the new files.
I added the apache license text to the 2 new xrts files since they were missing.
Completed: At revision: 532908
> 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
> Attachments: trinidad.zip, trinidad2.zip, trinidad2b.zip, trinidad3a.zip, trinidad3b.zip
>
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidad2b.zip
Change based on review feedback. This is the second part that includes xrts files. For review only.
> 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
> Attachments: trinidad.zip, trinidad2.zip, trinidad2b.zip
>
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jijun wang updated ADFFACES-441:
--------------------------------
Description:
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)
was:
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. Could we add needed API?
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)
> 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
> Environment: Generic
> Reporter: jijun wang
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidad3b.zip
patch based on rev. 532422
> 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
> Attachments: trinidad.zip, trinidad2.zip, trinidad2b.zip, trinidad3a.zip, trinidad3b.zip
>
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidadexc1b.patch
For review only. New file for exception change.
> 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, trinidadexc1b.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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidad3a.zip
patch based on rev. 532422
> 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
> Attachments: trinidad.zip, trinidad2.zip, trinidad2b.zip, trinidad3a.zip
>
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jijun wang updated ADFFACES-441:
--------------------------------
Status: Patch Available (was: Open)
> 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
>
> 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.
Re: [jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by Blake Sullivan <bl...@oracle.com>.
jijun wang (JIRA) wrote:
> [ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> jijun wang updated ADFFACES-441:
> --------------------------------
>
> Attachment: trinidad2.zip
>
> Change based on review feedback. For review only.
> Correct eol issue in diff file.
>
>
>> 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
>> Attachments: trinidad.zip, trinidad2.zip
>>
>>
>> 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);
>>
Why would we add a Convenience function to TrinidadLogger that
1) Checked that the Level was loggable
2) Created a LogRecord with the level and message
3) Set the resource bundle
4) Set the parameters
5) Set the thrown
6) Logged the record to the Logger
>> 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)
>>
>
>
Why do we need this if we have the above convenience function?
-- Blake Sullivan
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "jijun wang (JIRA)" <ad...@incubator.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: trinidad2.zip
Change based on review feedback. For review only.
Correct eol issue in diff file.
> 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
> Attachments: trinidad.zip, trinidad2.zip
>
>
> 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.
[jira] Updated: (ADFFACES-441) Adding localization to logging
message and exception
Posted by "Adam Winer (JIRA)" <ad...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/ADFFACES-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Winer updated ADFFACES-441:
--------------------------------
Resolution: Fixed
Fix Version/s: 1.0.1-incubating-core-SNAPSHOT
Assignee: Jeanne Waldman
Status: Resolved (was: Patch Available)
Fixed.
> 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
>
>
> 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.