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 Bill Milbratz <Bm...@participate.com> on 2002/07/16 16:35:18 UTC

log4j, xml logging, and multiple renderers per object

Hello, 

I'm looking at using log4j 1.2.5 for additional 'application logging' (i.e.
logging accessible by our application) as well as  'debug/info/warn/error'
logging.

I know what I want to do.  My question is, can I use log4j, out-of-the-box,
to implement this or do I need to extend it or use additional coding (jms,
etc).

Background:
Our app currently uses log4j for debug/info/warn logging. We're adding a new
subsystem which will run user-defined processes. For this new subsystem we
want to monitor a process and log the output so that the applications can
easily display it.

Specifically I want to:
-continue using our 'debug/info/warn' logging as is. 
-Add additional logging for a new subsystem which would direct the output to
an xml file. (i.e. a new appender)
-create new object renderers to render value objects as xml.  (i.e. and
nicely handle nested value objects and collections )
-Only use the xml-object renderer for this new xml-appender. i.e. of our
current 'debug/info/warn' executes log.info(user) where "user" is a vlue
object, I want it to use the DefaultRenderer, not render as xml.
-Use MDC or NDC to track interleaved- output.
-Subsequently use XSLT to nicely display the XML log...filtered by MDC...

Any suggestions? I spent some time this weekend looking over the log4j 1.2.5
code and the mail list archives. My main concern is that AFAIK you can't
define two object renderers for the same object (i.e. a plain text one and
an xml one).

But I might be missing something.

thanks in advance.

bil milbratz







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