You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Basilio James <ja...@siemens.com> on 2002/11/20 18:53:39 UTC

recommendations for i18n log files

Hi everyone.

I'm interesting in finding others experiences with logging in i18n
scenarios.  I'd like to see if there are any patterns that have fallen out
of the woodworks.

I am wrestling with the question of how to handle i18n of log messages (and
more specifically WHERE) to i18n the message.  My application will be
deployed across many languages and the logs need to be written in the locale
where it is installed.  However, if support dictates, English will be the
language of choice if the support call is raised high enough.

My question is:
A)
Should the log message be translated BEFORE logging?

i.e.
log.error(resourceBundle.getString("database_error"));

B)
Should the message be translated AFTER logging (in the viewer)?

i.e.
log.error("database_error");

The viewer (that must be written) must now go into the resource bundle and
translate this message before displaying it.


I do realize in A that some optimizations can be made such as wrapping the
logging class and only performing the i18n of the string if that logging
level is actually set.


Any opinions?  Do any of you log in an i18n application scenario?  How did
you solve this?

TIA,

Jim



-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
Health Services Corporation and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to CSOffice@smed.com.  Thank you



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>