Hi all.

I have an abstract class that has many subclasses. There are several options:

1. Declare it in the abstract class using the String name of the abstract class. For example:

protected static final Logger logger = Logger.getLogger("org.happy.Superclass"); // Logger does not have name of concrete class.

2. Declare it in the abstract class using the Class of the abstract class. For example:

protected final Logger logger = Logger.getLogger(getClass().getName()); // Not declared static as book suggests.

3. Declare it in the subclasses using the String name of each subclass.

protected static final Logger logger = Logger.getLogger("org.happy.ConcreteClass"); // Logger for each subclass. Lots of loggers.

4. Declare it in the subclasses using the Class of each subclass.

protected final Logger logger = Logger.getLogger(getClass().getName()); // Not declared static as book suggests.

Which of the above options should I use?

Thanks,

Bob Pepersack


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



Reply via email to