I am instantiating a log4j object inside of a class which inherits most of the methods and attributes from a parent class. Right now I'm getting logging messages from the subclass only. How can I get logging messages to output in both the super class and subclass?
EDIT: The way I am do the logging is that I have an instance variable in both the subclass and superclass, so it would look something like the following:
public class SuperClass {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(SuperClass.class);
/* Rest of code goes here */
} // end SuperClass
And the same for the subclass.
My log4j configuration:
## gps log4j.rootLogger==ERROR, clientLog, catissuecoreclientLog
log4j.rootLogger==DEBUG, clientLog, catissuecoreclientLog
### direct messages to file hibernate.log ###
log4j.appender.clientLog=org.apache.log4j.FileAppender
log4j.appender.clientLog.File=./log/client.log
log4j.appender.clientLog.layout=org.apache.log4j.PatternLayout
log4j.appender.clientLog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.catissuecoreclientLog=org.apache.log4j.FileAppender
log4j.appender.catissuecoreclientLog.File=./log/catissuecoreclient.log
log4j.appender.catissuecoreclientLog.layout=org.apache.log4j.PatternLayout
log4j.appender.catissuecoreclientLog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1} - %m%n
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
#log4j.rootLogger=warn, stdout
#log4j.rootLogger=warn, file
#log4j.logger.org.hibernate=info
### log just the SQL
#log4j.logger.org.hibernate.SQL=debug
### log JDBC bind parameters ###
log4j.logger.org.hibernate.type=info
### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=debug
### log cache activity ###
#log4j.logger.org.hibernate.cache=debug
### log JDBC resource acquisition
#log4j.logger.org.hibernate.jdbc=debug
### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace