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




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to