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 "Chan, Christopher" <ch...@eds.com> on 2002/12/09 06:31:39 UTC

Using Log4j in Abstract Classes

Hi,

I have searched the archives but could not find an answer to the below
problem I am having.....

In my Abstact class I create a logger wrapper object (similar to the
commons-logger wrapper) as follows:


public abstract class MyAbstractClass {

	private static Log4jLogger logger = new
Log4jLogger(MyAbstractClass.class.getName());
}



I have a class that extends this abstract class as follows:

public class $CLASS_NAME$ extends MyAbstractClass {

	private static Log4jLogger logger = new
Log4jLogger($CLASS_NAME$.class.getName());
}


When make a log call (eg.  logger.info("my message") ) in the class
$CLASS_NAME$, the message works fine.  However, any log calls in abstract
class do not get displayed.


How do I get the log messages to work in the abstract class? Have I left
something out?

Thanks
Chris


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