logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Clay" <clay.john...@vignette.com>
Subject backend l10n
Date Tue, 06 Mar 2001 17:13:54 GMT
Folks, 

I have a requirement to defer l10n processing to appenders, rather than at
the publisher of the log event, in order that different appenders may
localize the same event according to different locales.  Since the l10n
methods in Category rely on preregistered ResourceBundles, that doesn't
work. Furthermore, with only a cursory look at the internals, it appears
log4j converts the message Object to a String to construct a LoggingEvent
*prior* to distributing that to all appenders.  If that is true, I worry
whether my requirement can be met without substantial
modification/extension.

One approach is to marshall my ResourceBundle name, key, and replaceables
into a string, and then implement my own Appender that unpacks these,
localizes according to *its* Locale (determined at construction), and then
proceeds to log the localized String.  The immediate concern with this
approach is apparent forfeiture of all existing Appender functionality that
I otherwise want to leverage, as well as Layout processing, since I would
have co-opted it to marshall my Object.

Please tell me there's a simpler way to do this that doesn't up-end the
framework.

Thanks,
Clay




Mime
View raw message