Try this:
public class AbstractLoggable{
private static transient Logger logger;
protected Logger getLogger(){
if( logger == null ){
logger = Logger.getLogger(getClass());
}
return logger;
}
}
whallah! efficient OO programming with an accessor for subclasses and the proper class name to go with it!
-Kevin Ross
Vladimir R. Bossicard wrote:
Logger.getLogger(getClass()) at least, whether or not you use the string name is of no consequence.have you ever tried to call a non-static method within a static reference?if you get this working: private static Log log = LogFactory.getLog(getClass()); I give you a high-five. -Vladimir -- Vladimir R. Bossicard www.bossicard.com
