> > A colleague thinks the answer may involve ObjectRenderer.
> There's little
> > said about it in the javadoc. Is it, or can it be used as
> a plugin to alter
> > the behavior of a predefined appender? If so, could I use
> it perform l10n
> > in the appender(s)?
>
> Yes you probably could. Your ObjectRenderer would know about your
> special type of Objects and would convert to String in locale specific
> manner.
>
I took a look at the Category source, and it would appear ObjectRenderer is
called there (and not by the appenders) to create the LoggingEvent:
protected
void forcedLog(String fqn, Priority priority, Object message, Throwable t)
{
String s;
if(message instanceof String) {
s = (String) message;
} else {
s = myContext.rendererMap.findAndRender(message);
}
callAppenders(new LoggingEvent(fqn, this, priority, s, t));
}
So, unless the appearance here is very misleading, ObjectRenderer is just a
log4j alternative to toString(), presumably so that the latter is preserved
for other use by the application.
Thanks,
Clay
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]