logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Yost" <Alan.Y...@yambay.com>
Subject Getting the root directory of my ear file from a servlet.
Date Thu, 08 Aug 2002 16:12:26 GMT
Hi all,
 
I'm trying to use the init() method of a class that extends HttpServlet to read in a properties
file when a servlet is first deployed.  I have looked at the example on pg 13 of Ceki Gulcu's
"Short introduction to log4j" related to configuring log4j during initialisation.  The problem
I seem to be having is that when I specify the following code I don't get the expected real
path - but one that JBoss "mirrors" in the background.
 
e.g
 
String prefix  =  config.getServletContext().getRealPath("/log4j.lcf");
 
Rather than return the get JBoss\..\deploy\MyDeployFile.ear\mypath I get something like:
 
C:\Documents and Settings\alany\Local Settings\Temp\Jetty__8080___yambay\webapp\meta-inf\log4j.lcf
 
Ideally what I would like to be able to do is to have a configuration file in the root of
"MyDeployFile.ear" and reference this but I am not sure how to get this address.
 
Any ideas would be appreciated.
 
 
Regards
 
 
Alan.
 
 
Mime
View raw message