Hi there,
This is probably a common problem. I have searched through the web and looked
through
various sample configuration, and cannot see where I have gone wrong.
I am trying to get a Rolling File Logger going on my system. I have tried this
both on linux
(production machine) and windows (development machine).
Basically no log file is created, and all output still goes to the console. Can
anybody give me
some pointer on where I went wrong.
--- Windows Log4j Config File --
# Set root category priority to ERROR and its appender A1.
# At startup only ERROR level messages will be logged by default.
# If you wish to add lower level reporting specify the specific
# hierarchy member in the Category/Hierarchy section of this file
log4j.rootCategory=DEBUG, R
############################################################
# C O N S O L E L O G G I N G
#
############################################################
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
# Note: Using the Date format specification and 'M' option slows
down logging, but in
# our case it doesn't matter as we are only really logging ERRORS
by default and which
# will switch to DEBUG only when we have to resolve a problem.
#
# Format is [Date (with Format), ErrorLevel, Class name(without
package prefix), Method name, Message]
log4j.appender.A1.layout.ConversionPattern=CRMLOG:%d{yyyy-MM-dd
HH:mm:ss}:%5p (%c{1}:%M) - %m%n
############################################################
# F I L E L O G G I N G
#
############################################################
log4j.appender.R=org.apache.log4j.RollingFileAppender
# Don't know how to add a path to this file, currently it will
# get written to the TOMCAT_HOME directory
log4j.appender.R.File=C:/Apache_Group/Tomcat4/logs/app_log.log
log4j.appender.R.MaxFileSize=10MB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=APPLOG:%d{yyyy-MM-dd
HH:mm:ss}:%5p (%c{1}:%M) - %m%n
############################################################
# S E T R E P O R T I N G L E V E L
#
############################################################
log4j.category.com.crm.util.DBAction=DEBUG
log4j.category.com.crm=WARN
############################################################
# MY D O C O
#
############################################################
#NOTE: Once you set hierarchy to an error level it will stay at
that reporting level
# until you explicitly set it back. Changing the error level
at a higher level
# will not reset the reporting of the hierarchies you have
explicitly changed, you
# have to explicitly reset them manually.
# To show debug info specify the class name here
# Example usage:
# log4j.category.com.crm.util.PaulLog=DEBUG - Will show all
messages down to DEBUG level only in PaulLog
# log4j.category.com.crm.util=DEBUG - Will show all
messages down to DEBUG level for any class
# in the
com.crm.util package
# log4j.category.com.crm=DEBUG - Will show all
messages down to DEBUG level for any class
# under the
com.crm hierarchy
--- End File --