Customize the diagnostic log properties within rmmlog.properties:
Figure 1. The diagnostic log properties, rmmlog.properties#************************************************************************************************
# Logger configuration
#************************************************************************************************
# Define root logger level and appender
# { DEBUG | INFO | WARN | ERROR | FATAL }
#************************************************************************************************
log4j.rootLogger = INFO, R
#************************************************************************************************
# Define appender as RollingFileAppender
#************************************************************************************************
#log4j.appender.R = org.apache.log4j.ConsoleAppender
log4j.appender.R = org.apache.log4j.RollingFileAppender
log4j.appender.R.File = rmmcim.log
log4j.appender.R.MaxFileSize = 500KB
log4j.appender.R.MaxBackupIndex = 9
#************************************************************************************************
# Define logging format
# (see http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html)
#
# c Category
# For example, for the category name "a.b.c" the pattern %c{2} will output "b.c"
# C Fully qualified class name of the caller
# For example, for the class name "org.apache.xyz.SomeClass", the pattern %C{1} will output
# "SomeClass".
# WARNING Generating the caller class information is slow.
# d Date of the logging event.
# The date conversion specifier may be followed by a date format specifier enclosed between
# braces.
# For example, %d{HH:mm:ss,SSS} or %d{dd MMM yyyy HH:mm:ss,SSS}.
# If no date format specifier is given then ISO8601 format is assumed.
# F File name where the logging request was issued.
# WARNING Generating caller location information is extremely slow.
# l Location information of the caller which generated the logging event.
# Usually consists of the fully qualified name of the calling method
# followed by the callers source the file name and line number between parentheses.
# The location information can be very useful. However, its generation is extremely slow.
# L Line number from where the logging request was issued.
# WARNING Generating caller location information is extremely slow.
# m Application supplied message associated with the logging event.
# M Method name where the logging request was issued.
# WARNING Generating caller location information is extremely slow.
# n Line separator character or characters.
# p Priority of the logging event.
# r Number of milliseconds elapsed since the start of the application until the creation of the
# logging event.
# t Name of the thread that generated the logging event.
# x NDC (nested diagnostic context) associated with the thread that generated the logging event.
# X MDC (mapped diagnostic context) associated with the thread that generated the logging event.
# The X conversion character must be followed by the key for the map placed between braces,
# as in %X{clientNumber} where clientNumber is the key.
# The value in the MDC corresponding to the key will be output.
# % The sequence %% outputs a single percent sign.
#
# format modifier examples:
# %20c Right justify and left pad with spaces if category is smaller than 20 characters.
# %-20c Left justify and right pad with spaces if category is smaller than 20 characters.
# %.30c Truncate from the beginning if the category name is longer than 30 characters.
# %20.30c Left pad with spaces if the category name is shorter than 20 characters.
# However, if category name is longer than 30 characters, then truncate from the beginning.
# %-20.30c Right pad with spaces if the category name is shorter than 20 characters.
# However, if category name is longer than 30 characters, then truncate from the beginning.
#****************************************************************************************************
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%-25F:%5L %-20M] %-5p - %m%n
The parameters in the rmmlog.properties file are:
- log4j.rootLogger
- Set the logger level to either:
- DEBUG
- Used for problem diagnosis, this setting results in a very detailed
log report. This setting is not recommended for normal use.
- INFO
- Suggested for normal operation.
- WARN
- Suggested for normal operation.
- ERROR
- Suggested for normal operation.
- FATAL
Note: Do not change "R". It is a reference to the logger object.
- log4j.appender.R
- Appends all entries into a file. Do not change this setting,
unless you want another behavior (for example, you want ConsoleAppender
output to go to the screen instead of to a file).
- log4j.appender.R.File
- Specifies the name of the log file.
- log4j.appender.R.MaxFileSize
- Specifies the maximum file size. If this file size is exceeded,
the suffix .1 is attached to the filename and logging starts with
a new filename.
- log4j.appender.R.MaxBackupIndex
- Specifies the number of times a file can exceed its MaxFileSize
before the oldest backup file is discarded. For example, if this variable
is set to 9, the file can have 9 backup files, but on the tenth time
that this file exceeds its MaxFileSize, the oldest backup file is
discarded.
- log4j.appender.R.layout
- Defines the format of each log entry. Although it is not suggested
to change this, it can be adapted to other formats.
- log4j.appender.R.layout.ConversionPattern
- Defines the format of each log entry. Although it is not suggested
to change this, it can be adapted to other formats.