1. The super-class logger: SuperClazz
2. Define the loggers as follows:
private Logger log=Logger.getLogger(getClass());

On 6/6/06, Konstantinos Karadamoglou <[EMAIL PROTECTED]> wrote:
Hello all,

I have two questions about Loggers and Inheritance. Lets assume that we have
following class inheritance:

public class SuperClazz{
  private Logger log=Logger.getLogger(SuperClazz.class);

  private void method1(){
     log.info("method1 invoked");
  }

}
//------------------------
public class ChildClazz1 extends SuperClazz{
  private Logger log=Logger.getLogger(ChildClazz1.class);

  private void method2(){
     log.info("method2 invoked");
  }

}
//------------------------
public class ChildClazz2 extends SuperClazz{
  private Logger log=Logger.getLogger(ChildClazz2.class);

  private void method3(){
     log.info("method3 invoked");
  }

}

1) if method1 is invoked (somehow) which Logger is used and what the logger
display name will be at the console?

2) How can I enforce method1 to use the logger of the child method?

Thank you in advance, Kostas




--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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

Reply via email to