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 "Klein, Scott @ TW" <sc...@L-3com.com> on 2002/07/12 00:06:46 UTC

adding custom ObjectRenderer

After looking through the list archive I thought that I had found my answer,
but I must be missing a detail because the proper LoggingEvent messages
don't seem to be going through my ObjectRenderer:

I have tried to add my ObjectRenderer in my config.xml file:

	<renderer renderedClass="foo.NeedsCustomRenderer"
    		  renderingClass="foo.bar.CustomRenderer"/>

and also programatically:

        LoggerRepository rp = LogManager.getLoggerRepository();
        if ( rp instanceof Hierarchy ) {
                Hierarchy h = ( Hierarchy ) rp;
                h.addRenderer( foo.NeedsCustomRenderer.class,
                			   new CustomRenderer() );
        } else {
                LogLog.error( "LoggerRepository is NOT a Hierarchy" );
        }

In th first case I receive notice that the renderer info has at least been
noticed, and in the second I do not get the error output. However, when I
test my logging:

		logger.error( new NeedsCustomRenderer() );

all I get in the log is the result of a toString() call.....from the mail
archives, this seems to be all that is needed, although there have been some
posts with similar problems that have not been replied to. Am I missing
something here?



thanks
scott

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