How to configure log4j.properties in Tomcat 5.5 to enable different logging levels

Technote (FAQ)


Question

This technote provides you with information about the configuring of log4j.properties in Tomcat 5.5 to enable different logging levels for IBM Rational Portfolio Manager.

Answer

There are two files needed to enable log4j.properties for different logging levels in Rational Portfolio Manager; log4j-1.2.8.jar and log4j.properties. A user has to ensure that the files exist in the following locations:

log4j-1.2.8.jar should be placed in %TOMCAT DIR%\shared\lib
log4j.properties should be placed in %TOMCAT DIR%\WEB-INF\Classes

Once the user has confirmed that the files are placed in the right directory, the next step would be to set values for some parameters in log4j.properties to reflect the logging level the user needs. In this technote, we will not be discussing all the parameters in the log4j.properties file, but only the ones that the user would need to enable the desired logging level. Listed below are the parameters that we will be discussing in this technote:

log4j.rootLogger
log4j.appender.R.File
log4j.appender.R.MaxFileSize
log4j.appender.R.MaxBackupIndex


1. log4j.rootLogger

This parameter specifies the logging level being used. The following is a summary of different log4j log levels for Tomcat 5.5:
All is the highest level of tracing and this level will show all logging transactions.
Debug shows more detail of all the debugging levels for tracking transactions in the middleware.
Error level of logging will show events with errors and should allow the RPM application to function when this is on.
Fatal level of logging will show events that are severe enough to force the middleware application to terminate.
Info level of logging will show the events of the application server.
Trace Events level of logging will show the events of the application server with more granularity than then the DEBUG level.
Trace_INT level of logging will show the integer value of the Trace Level of logging
Warn level of logging will show all possible warnings.


2. log4j.appender.R.File

This parameter specifies the location of the log4j file. It is important that double back slashes are used in the assigned value. For example, if the location of the file is d:\temp\stdout.log, the value assigned to this parameter should be written as:
log4j.appender.R.File=d:\\temp\\stdout.log


3. log4j.appender.R.MaxFileSize

This parameter specifies the maximum size of the log file. Once the log file size reaches the MaxFileSize value, a new log file will be created and it will continue to write the log to the new file.


4. log4j.appender.R.MaxBackupIndex

This parameter specifies number of log files to be kept in the location specified in log4j.appender.R.File. For example, setting the log4j.appender.R.MaxBackupIndex value to 2 would mean one back up log4j log file and one active log4j log file in the log4j.appender.R.File directory.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Portfolio Manager
Installation and Configuration: Middleware

Software version:

7.0.0.0, 7.0.1.1, 7.0.2.2, 7.0.3.3, 7.0.4.4, 7.0.5.5, 7.1, 7.1.0.1, 7.1.1.1, 7.1.1.2

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1388851

Modified date:

2011-03-16

Translate my page

Machine Translation

Content navigation