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 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/log4j.axis2.properties. The setupServer
target copies it to ${catalina.home}/common/classes. The deployaar ant
target copies the same
file to ${catalina.home}/webapps/axis2/WEB-INF/classes/log4j.properties.
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.
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.
OSCARS war logging
Uses the file that is included in
OSCARS.war at classes/log4.properties. Deployed at
${CATALINA_HOME}/webapps/OSCARS/WEB-INF/classes/log4j.properties. This
file is included in the distribution in conf/server/log4j.properties.
It is sometimes necessary to add log4j.jar to the OSCARS/WEB-INF/lib
directory to get the logging to the oscars.log file to happen.
Scheduler logging
The scheduler is started by the
tools/scheduler.sh script which sets the location of the logging
configuration file to
${CATALINA_HOME}/webapps/OSCARS/WEB-INF/classes/log4j.properties.
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.