I'm using an initialization servlet with the following lines in the init() 
method:

         String logFile = config.getInitParameter("logPath");
         String prefix = getServletContext().getRealPath("/");
         System.out.println("prefix: " + prefix);
         if (logFile != null) {
             PropertyConfigurator.configure(prefix + "WEB-INF\\classes\\" + 
logFile);
         }

In web.xml the init parameter is defined as log4j.properties.

The servlet reads log4j.properties where it finds the following:

log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=arachneTest.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

The problem (as I see it) is that the output log ends up in 
<Tomcat_Home>\bin, whereas I'd like it to be in <Tomcat_Home>\webapps\MyApp 
(or some subdirectory of MyApp like 'log'). However any attempt to prepend 
the filename in log4j.properties with path information generates a File Not 
Found error.

Can this be done? If so, How????

Thanks in Advance for any ideas,

Joseph Polanik






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

Reply via email to