logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prünte Kai <Prue...@ssi-schaefer-noell.com>
Subject AW: Internationalization with log4j ?
Date Thu, 04 Mar 2004 15:29:10 GMT
Hi, 

several month ago, I had a similar question without an answer.

Log4j has some methods for it: Category.l7dlog()
However this does not fit to my requirements, because the message is translated during creating
and not during writing by an appender. I call this lazy localisation. The lazy localiszation
has the advantage, that you are able to write a xxx_en.log and a xxx_de.log with the same
messages but different localisations.
If you need that, you have to do:
 - implement your own log methods like: localisedInfo(String key, Object[] params)
 - you need your specialised LoggingEvent like LocalisedLoggingEvent
 - you need special appender which have additional paramter for the localisation

I have such implementations if you are interested in.

Regards,
Kai Prünte

-----Ursprüngliche Nachricht-----
Von: Juergen.Bauer@sit.rohde-schwarz.com
[mailto:Juergen.Bauer@sit.rohde-schwarz.com]
Gesendet: Donnerstag, 4. März 2004 16:17
An: Log4J Users List
Betreff: Internationalization with log4j ?







Greetings,

I intend to realize my logging in my project with the log4j package, but I
need the internationalization of looging messages, e.g. written in German
or English language in a file depend on an attribut setting.
But I don't know to do this for the best, in a simple way.
In SYSLOG their are codes for facility/severity, which can be transformed
into the right text.
But how to manage the message itself, which normally is written in const
string in source code.

Thoughts and ideas about possible solutions would be very appreciated.


Regards,
Juergen Bauer


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message