tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mufaddal Khumri <>
Subject Log4j with Tomcat webapp
Date Fri, 29 Oct 2004 23:39:10 GMT

I am trying to use this under Tomcat 5.0.27.

I have the following file under WEB-INF/conf/
# initialise root logger with level DEBUG and call it A1
log4j.rootLogger=DEBUG, A1
# set the appender to be FileAppender
# set set that layout to be SimpleLayout

I have the following in my web.xml

I do the following in my Log4jInitServlet:

String baseDir = getServletContext().getRealPath( "/" );
String logPath = config.getInitParameter(log4j-log-path);
logPath = baseDir + logPath;
File logPathDir = new File( logPath );
System.setProperty( "log.home", logPath );
PropertyConfigurator.configureAndWatch( confFile );

When I start my tomcat engine, I do not get any exceptions but my log 
file does not get created? Am I missing something in my file while specifying log4j.appender.A1.file ? or 
something else? I do not get any exceptions in catalina.out.

I am trying to understand if this problem is due to my configuration of 
Tomcat or the configuration of my logger?

Mufaddal Khumri

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message