Hi!

I have the following Java classes:


abstract class AbstractAnimal {

 Logger logger = Logger.getLogger(AbstractAnimal.class);

 protected void something() {
   logger.debug("animal is doing something");
 }
}

class Dog extends AbstractAnimal {

 Logger logger = Logger.getLogger(Dog.class);

 protected void anything() {
   logger.debug("dog is doing anything");
   something();
 }
}

class Cat extends AbstractAnimal {

 Logger logger = Logger.getLogger(Cat.class);

 protected void nothing() {
   logger.debug("cat is doing nothing");
   something();
 }
}


Note that the classes are in three difference packages
and the log4j.properties looks like the following:


log4j.logger.Dog=ALL, R1
log4j.appender.R1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R1.File=dog.log

log4j.logger.Dog=ALL, R2
log4j.appender.R2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R2.File=cat.log


The above configuration only logs "dog is doing anything" to dog.log
and "cat is doing nothing" to cat.log.

How can I configure Log4j so that it will also log "animal is doing
something" in both log files?

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

Reply via email to