I use a String as the argument. It's crude, but I thought it would never break.
static final Logger logger = Logger.getLogger("LoggerName"); Is it possible for the String to become null? On 12/7/05, Nicolas De Loof <[EMAIL PROTECTED]> wrote: > > > your Nullpointer is thrown in CategoryKey constructor : > CategoryKey(String name) { > this.name = name; > > hashCache = name.hashCode(); > } > > This sounds like you try to create a logger with a null category name. > > To avoid this, you may use the class to build your loggers : > private static Logger logger = Logger.getLogger(MyClass.class); > > Nico > > Jeff Drew a écrit : > > >My application had an error in the log4j code. It is likely a problem in > my > >code, but I'd appreciate any insights into what this particular error > >implies. This code has been running for quite without seeing this > error. > > > >java.lang.NullPointerException > > at java.lang.String.intern()Ljava.lang.String;(Unknown Source) > > at org.apache.log4j.CategoryKey.<init>(Ljava.lang.String;)V( > >CategoryKey.java:20) > > at org.apache.log4j.Hierarchy.getLogger(Ljava.lang.String > >;Lorg.apache.log4j.spi.LoggerFactory;)Lorg.apache.log4j.Logger;( > >Hierarchy.java:252) > > at org.apache.log4j.Hierarchy.getLogger(Ljava.lang.String > >;)Lorg.apache.log4j.Logger;(Hierarchy.java:233) > > > >Thanks > > > > > > > > This message contains information that may be privileged or confidential > and is the property of the Capgemini Group. It is intended only for the > person to whom it is addressed. If you are not the intended recipient, you > are not authorized to read, print, retain, copy, disseminate, distribute, > or use this message or any part thereof. If you receive this message in > error, please notify the sender immediately and delete all copies of this > message. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >