Fedora uses Log4J for logging. For
detailed information about using Log4J, consult the Log4J Manual: http://logging.apache.org/log4j/docs/manual.html.
The log configuration file is located at
FEDORA_HOME/server/config/log4j.properties. Changes to the logging
configuration will not be reflected until Fedora is restarted.
Normally, coarse-grained logs for Fedora are written to
FEDORA_HOME/server/logs/fedora.log. The following examples show the
kinds of configuration changes you can make to aid in debugging.
To change the level to DEBUG for all Fedora classes, change the
log4j.logger.fedora line to the following:
log4j.logger.fedora = DEBUG, FEDORA
To change the level to DEBUG for just one class, add the following
lines:
log4j.logger.fedora.server.utilities.SQLUtility = DEBUG, FEDORA
log4j.additivity.fedora.server.utilities.SQLUtility = false
To change the level to DEBUG for a whole package, add the following
lines:
log4j.logger.fedora.server.resourceIndex = DEBUG, FEDORA
log4j.additivity.fedora.server.resourceIndex = false
To send all DEBUG messages for a package to STDERR, with methods and
line numbers add the following lines:
log4j.logger.fedora.server.security = DEBUG, SECURITY
log4j.additivity.fedora.server.security = false
log4j.appender.SECURITY = org.apache.log4j.ConsoleAppender
log4j.appender.SECURITY.target = System.err
log4j.appender.SECURITY.layout = org.apache.log4j.PatternLayout
log4j.appender.SECURITY.layout.ConversionPattern = %p %d{HH:mm:ss.SSS} [%t] (%c{1}.%M:%L) %m%n
To send all DEBUG messages for a package to a dedicated file, with
methods and line numbers, add the following lines:
log4j.logger.fedora.server.security = DEBUG, SECURITY
log4j.additivity.fedora.server.security = false
log4j.appender.SECURITY = org.apache.log4j.RollingFileAppender
log4j.appender.SECURITY.File =
log4j.appender.SECURITY.MaxFileSize = 20MB
log4j.appender.SECURITY.MaxBackupIndex = 5
log4j.appender.SECURITY.layout = org.apache.log4j.PatternLayout
log4j.appender.SECURITY.layout.ConversionPattern = %p %d{HH:mm:ss.SSS} [%t] (%c{1}.%M:%L) %m%n
Note: if log4j.appender.SECURITY.File is left empty, the file will be
automatically created at FEDORA_HOME/server/logs/security.log