I am trying to use log4j in my application under Tomcat 5.5. However, it is
producing mounds of debugging information but none of it lists the items I
specify. Here is a portion of my application, the config file, and a portion of
the output. Please note that logger.debug("TestServlet: Debugging) never gets
printed in the log file even though the function gets called!

// TestServlet
public class TestServlet extends HttpServlet {
        private static Logger logger =
Logger.getLogger(GenerateChartServlet.class.getName());

        public TestServlet() {
                PropertyConfigurator.configure("log4j.properties");
        }

        private void doPost(HttpServletRequest req, HttpServletResponse res)
                throws IOException, ServletException
        {
                ...
                // This never gets outputted to log file
                logger.debug("TestServlet: Debbuging");
                ...
        }
}

#
# Log4j configuration file.
#
log4j.rootCategory=DEBUG, A2

# Available levels are DEBUG, INFO, WARN, ERROR, FATAL
#
#
# A2 is a DailyRollingFileAppender
#

log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=logs/tomcat.log
log4j.appender.A2.datePattern='.'yyyy-MM-dd
log4j.appender.A2.append=true
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} [%t] - %m%n

#
#OUTPUT
#
DEBUG 2006-12-19 22:08:11,593 [main] -   bodyText=''
DEBUG 2006-12-19 22:08:11,593 [main] -   Fire body() for
ObjectCreateRule[className=org.apache.catalina.deploy.ContextResource,
attributeName=null]
DEBUG 2006-12-19 22:08:11,593 [main] -   Fire body() for
SetNextRule[methodName=addResource,
paramType=org.apache.catalina.deploy.ContextResource]
DEBUG 2006-12-19 22:08:11,593 [main] -   Popping body text ''
DEBUG 2006-12-19 22:08:11,593 [main] -   Fire end() for
SetNextRule[methodName=addResource,
paramType=org.apache.catalina.deploy.ContextResource]
DEBUG 2006-12-19 22:08:11,593 [main] -   Fire end() for
ObjectCreateRule[className=org.apache.catalina.deploy.ContextResource,
attributeName=null]
DEBUG 2006-12-19 22:08:11,593 [main] - [ObjectCreateRule]{web-app/resource-ref}
Pop org.apache.catalina.deploy.ContextResource
DEBUG 2006-12-19 22:08:11,593 [main] - ignorableWhitespace(

)
DEBUG 2006-12-19 22:08:11,594 [main] - endElement(,,web-app)
DEBUG 2006-12-19 22:08:11,594 [main] -   match='web-app'
DEBUG 2006-12-19 22:08:11,594 [main] -   bodyText=''
DEBUG 2006-12-19 22:08:11,594 [main] -   Fire body() for
[EMAIL PROTECTED]
DEBUG 2006-12-19 22:08:11,594 [main] -   Popping body text ''
DEBUG 2006-12-19 22:08:11,594 [main] -   Fire end() for
[EMAIL PROTECTED]
DEBUG 2006-12-19 22:08:11,594 [main] - endDocument()
DEBUG 2006-12-19 22:08:11,628 [main] - Opening /dev/urandom
DEBUG 2006-12-19 22:08:11,628 [main] - Registering
Catalina:type=Manager,path=/ftrade/graph,host=localhost
DEBUG 2006-12-19 22:08:11,628 [main] - Force random number initialization
starting
DEBUG 2006-12-19 22:08:11,628 [main] - Getting message digest component for
algorithm MD5
DEBUG 2006-12-19 22:08:11,628 [main] - Completed getting message digest
component
DEBUG 2006-12-19 22:08:11,628 [main] - getDigest() 0
DEBUG 2006-12-19 22:08:11,628 [main] - Force random number initialization
completed
DEBUG 2006-12-19 22:08:11,628 [main] - Start: Loading persisted sessions
DEBUG 2006-12-19 22:08:11,628 [main] - Loading persisted sessions from
SESSIONS.ser
DEBUG 2006-12-19 22:08:11,628 [main] - No persisted data file found
DEBUG 2006-12-19 22:08:11,628 [main] - Sending application start events
DEBUG 2006-12-19 22:08:11,628 [main] - Starting filters
DEBUG 2006-12-19 22:08:11,629 [main] - Parent class loader is: WebappClassLoader
..
..

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to