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 Matt Cox <MC...@DeWolfe.com> on 2002/05/22 18:05:11 UTC

ObjectRender

Hi,

I'm using 1.2.1 and I would like to implement my own custom ObjectRenderers.
It looks pretty straight forward in terms of implementing the ObjectRenderer
Class.  But after that I need some direction.  I'm assuming that I need to
add my implementation to the RendererMap for a given class type, but how do
I get the RendererMap?  

In the javadoc there is a method on Logger to get the hierarchy from which I
can get the RendererMap but this has been deprecated, with a reference to
use LogManager.getLoggerRepository().  But there is nothing on the
repository to allow me to get the RendererMap.

What am I missing?

Thanks,
Matt

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


Re: ObjectRender

Posted by Ceki Gülcü <ce...@qos.ch>.
Search for ObjectRenderer in

http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html

The same but a little quicker:

http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String,%20org.apache.log4j.spi.LoggerRepository)

At 17:32 24.05.2002 -0400, you wrote:
>Matt,
>
>I posted the same question on May 16th. So far there has been no reply
>but this worked for me:
>
>((Hierarchy)log.getLoggerRepository()).addRenderer(MyClass.class, new
>MyRenderer());
>
>Surely there must be a better way - maybe in a properties file.
>
>
>----- Original Message -----
>From: "Matt Cox" <MC...@DeWolfe.com>
>To: <lo...@jakarta.apache.org>
>Sent: Wednesday, May 22, 2002 12:05 PM
>Subject: ObjectRender
>
>
> > Hi,
> >
> > I'm using 1.2.1 and I would like to implement my own custom
>ObjectRenderers.
> > It looks pretty straight forward in terms of implementing the
>ObjectRenderer
> > Class.  But after that I need some direction.  I'm assuming that I
>need to
> > add my implementation to the RendererMap for a given class type, but
>how do
> > I get the RendererMap?
> >
> > In the javadoc there is a method on Logger to get the hierarchy from
>which I
> > can get the RendererMap but this has been deprecated, with a reference
>to
> > use LogManager.getLoggerRepository().  But there is nothing on the
> > repository to allow me to get the RendererMap.
> >
> > What am I missing?
> >
> > Thanks,
> > Matt
> >
> > --
> > To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
> > For additional commands, e-mail:
><ma...@jakarta.apache.org>
> >
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Ceki


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


Re: ObjectRender

Posted by Duncan Swain <ds...@sympatico.ca>.
Matt,

I posted the same question on May 16th. So far there has been no reply
but this worked for me:

((Hierarchy)log.getLoggerRepository()).addRenderer(MyClass.class, new
MyRenderer());

Surely there must be a better way - maybe in a properties file.


----- Original Message -----
From: "Matt Cox" <MC...@DeWolfe.com>
To: <lo...@jakarta.apache.org>
Sent: Wednesday, May 22, 2002 12:05 PM
Subject: ObjectRender


> Hi,
>
> I'm using 1.2.1 and I would like to implement my own custom
ObjectRenderers.
> It looks pretty straight forward in terms of implementing the
ObjectRenderer
> Class.  But after that I need some direction.  I'm assuming that I
need to
> add my implementation to the RendererMap for a given class type, but
how do
> I get the RendererMap?
>
> In the javadoc there is a method on Logger to get the hierarchy from
which I
> can get the RendererMap but this has been deprecated, with a reference
to
> use LogManager.getLoggerRepository().  But there is nothing on the
> repository to allow me to get the RendererMap.
>
> What am I missing?
>
> Thanks,
> Matt
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


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