One thing that caused me a slight problem when setting up my object
renderers was that I was initializing log4j in a servlet running under
weblogic.  I needed to added my custom renderers and any imported classes
within to my system classpath when starting weblogic in order for them to be
located.

-----Original Message-----
From: Thomas Tuft Muller [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 28, 2002 11:43 AM
To: Log4J Users List
Subject: RE: ObjectRender


I'm experiencing some strange problemts with configuring renderers in the
xml config file: sometimes it works, sometimes it's not. Not sure why.

For a specific project, I _have_ to add the renderers programmatically with

        ( ( Hierarchy ) LogManager.getLoggerRepository() ).addRenderer(... )

It just _won't_ work when I add the renderers in the config file, even
though they appear to be accepted (no faults are reported to System.err
during configuration). Haven't had the time to investigate the problem, I
was maybe hoping someone here had a suggestion.

OS: Win2000, SP2
Log4j version: 1.2
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

--

Thomas




| -----Original Message-----
| From: Matt Cox [mailto:[EMAIL PROTECTED]]
| Sent: 28 May 2002 16:37
| To: 'Log4J Users List'
| Subject: RE: ObjectRender
|
|
| I've figured this one out but looking through the message archive.
|
| I've added the following lines to the log4j-config.xml:
|
| <renderer renderedClass="fully.qualified.class.typeToBeRendered"
|           renderingClass="fully.qualified.custom.object.renderer"/>
|
| Adding the above seemed to solve my problems.
|
| -----Original Message-----
| From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
| Sent: Friday, May 24, 2002 5:49 PM
| To: Log4J Users List
| Subject: Re: ObjectRender
|
|
|
| Search for ObjectRenderer in
|
| http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/Property
| Configurat
| or.html
|
| The same but a little quicker:
|
| http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/Property
| Configurat
| or.html#doConfigure(java.lang.String,%20org.apache.log4j.spi.Logge
| rRepositor
| y)
|
| 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" <[EMAIL PROTECTED]>
| >To: <[EMAIL PROTECTED]>
| >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:
| ><mailto:[EMAIL PROTECTED]>
| > > For additional commands, e-mail:
| ><mailto:[EMAIL PROTECTED]>
| > >
| >
| >
| >--
| >To unsubscribe, e-mail:
| <mailto:[EMAIL PROTECTED]>
| >For additional commands, e-mail:
| <mailto:[EMAIL PROTECTED]>
|
| --
| Ceki
|
|
| --
| To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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




*************************************************************************
Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved. 
The information supplied in this email should be treated in confidence.
No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

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

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

Reply via email to