home > Logging

Configuring Logging

Tomcat uses commons-logging out-of-the box, but will use log4j if the commons-logging.jar and log4j.jar files are copied to common/lib, and there is a log4j.properties file in common/classes. Axis2 defaults to use log4j. The OSCARS.aar inherits its logging configuration from axis2. The OSCARS.war finds its logging configuration in the war at WEB-INF/classes/log4j.properties. The list below shows where each component finds its log4j.properties file.

Tomcat logging

Uses the file ${CATALINA_HOME}/common/classes/log4j.properties. The commons-logging.jar and log4j.jar must be added to common/lib to enable log4j logging. Otherwise, Tomcat uses commons-logging. Tomat also uses conf/logging.properties to select log levels for various components. The levels are set originally to INFO, but may be changed to WARNING or SERVERE to reduce or eliminate the manager*.log, localhost*.log, host-manager*.log, admin*.log and catalina*.log. Since all messages at the INFO level are logged to catalina.out, these other logs are redundant.

The version of this file that is used at ESnet is included in the distribution in conf/server/common.log4j.properties. The setupServer target copies it to ${catalina.home}/common/classes. .

Axis2 Logging

Uses ${CATALINA_HOME}/webapps/axis2/WEB-INF/classes/commons-logging.properties to select no logging, simple logging or log4j. Uses the file ${CATALINA_HOME}/webapps/axis2/WEB-INF/classes/log4j.properties. The deployaar ant target copies conf/logging/axis2.log4j.properties file to ${catalina.home}/webapps/axis2/WEB-INF/classes/log4j.properties

OSCARS aar logging

Uses the file ${CATALINA_HOME}/webapps/axis2/WEB-INF/classes/log4j.properties, not the one that is included in OSCARS.aar/classes/log4j.properties. The deployaar target copies conf/server/axis2.log4j.properties to ${catalina.home}/webapps/axis2/WEB-INF/classes/log4j.properties.

OSCARS war logging

Uses the file that is included in OSCARS.war at WEB-INF/classes/log4j.properties. It is copied there from the source in conf/logging/oscars-war.log4j.properties by the oscars-war target. The wbui target adds log4j.jar to the OSCARS/WEB-INF/lib directory to ensure that the war will get its log4j.properties from OSCARS/WEB-INF/classes.

rmi core logging

The ant targets for aaa-core, oscars-core and notifybroker-core copy the respective conf/logging/{oscars-aar,oscars-caore,notifybroker-core}.log4j.properties to the jar files as log4j.properties. Once they are started from ${OSCARS_HOME} by the oscars.sh script their log files will be placed in ./logs/{oscars-aar, oscars, oscars-nb, hibernate, wire}.log

The following log files, all in ${CATALINA_HOME}/logs are of interest:
catalina.out
the root console log. All messages (except the httpwire and reservation ones) are put here as well as in some of the following logs.
hibernate.log
has output from the hibernate database modules
wire.log
logs what is sent as https messages from the forwarder module
oscars-aar.log
log messages from modules running from OSCARS. aar, e.g. process that started from the web services api
oscars.log
log messages from modules running from OSCARS.war, e.g. process that started from the WBUI
scheduler.log
log messages from the scheduler process
reservations
a directory holding the log messages  from bss.ReservationManager for each reservation that has been made.  The name of this directory is set in oscars.properties as logging.rsvlogdir. It is read by bss.ReservationLogger which dynamically sets a log appender to put the messages in a per/reservation file named by the GRI of the reservation.

Formatting conventions

Most lines are formatted as follows:

%d{ISO8601} [%5p] %c{2} %m%n

      %d{ISO8601} is date/time in the following format  2008-03-04 00:06:38,260
      %5p is the log level, e.g. DEBUG,INFO in a 5 character wide field
      %c{2} is the last two components of the class that is logging the message
      %m is the message that was logged
      %n is a newline.