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 Ed Soniat <es...@proficient.com> on 2001/11/28 21:37:47 UTC

RE: Extending Category questions/problems (NEVER MIND)

Never post questions on low biorhythm days.
Ed
> -----Original Message-----
> From: Ed Soniat 
> Sent: Wednesday, November 28, 2001 1:03 PM
> To: Log4J Users List
> Cc: spam1@pobox.com
> Subject: Extending Category questions/problems
> 
> 
> Two things, first a nit:
> 1. The example XCategory specifies that it is the minimum required but
> implements OptionHandler.  OptionHandler isn't required to extend
> Category is it?
> 
> 2.  I extend Category with NsaCategory and everything was happy for a
> day or two.  I changed a few class names (didn't follow coding
> standards) and now the static block in Category is placing an instance
> of Category in the HashMap before my getInstance call with the factory
> is called.  The Category is found with the name and so my 
> factory is not
> used and the remaining classes that expect  NsaCategory are very
> disappointed.
> 
> Any ideas why, out of the blue, the static block in Category 
> is getting
> called.  
> Here is a stack trace.  It happens on the dispatch of the static
> NsaCategory.getInstance(String) which for some reason causes 
> the static
> block of Category to run.  I suspect that for some reason or 
> other this
> static block was running when it wouldn't cause problems 
> before and now
> it isn't.  Any ideas on how to get it out of the way.
> 
> Thanks for the help.
> Ed
> -Dlog4j.configuration=file:/home/esoniat/proficient/developmen
> t/nsagloba
> l/http/resources/log/NsaLoggerConfig.xml
> log4j: Disable override="null".
> log4j: Disable ="null".
> log4j: Retreiving an instance of org.apache.log4j.Category.
> getInstance(com.nsaglobal.log.JDBCAppenderTest) called.
> java.lang.Throwable
> 	at org.apache.log4j.Hierarchy.getInstance(Hierarchy.java:289)
> 	at org.apache.log4j.Hierarchy.getInstance(Hierarchy.java:270)
> 	at
> org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigur
> ator.java:
> 291)
> 	at
> org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:691)
> 	at
> org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurat
> or.java:59
> 3)
> 	at
> org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurat
> or.java:54
> 5)
> 	at
> org.apache.log4j.helpers.OptionConverter.selectAndConfigure(Op
> tionConver
> ter.java:455)
> VVVVVVVV Things go bad here because I end up with a Category not a
> NsaCategory  VVVVVVVV
> 	at org.apache.log4j.Category.<clinit>(Category.java:146)
> 	at com.nsaglobal.log.NsaLogger.getCategory(NsaLogger.java:258)
> 	at com.nsaglobal.log.NsaLogger.<init>(NsaLogger.java:94)
> 	at com.nsaglobal.log.NsaLogger.getInstance(NsaLogger.java:120)
> 	at
> com.nsaglobal.log.JDBCAppenderTest.<clinit>(JDBCAppenderTest.java:41)
> 
> 
> --
> 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>