In my effort to find a solution to the problem I mentioned in another post I'm 
trying to setup minimal Velocity logging...

There must be something wrong with my setup (or with me :-)).

1) loadConfiguration is called (see above for source code) but NOT under cactus 
(it's normal I should find a way to do it manually), so I need to rely on 
velocity.properties to enable simple logging
No matter if under Cactus or not, the log file is not created

2) velocity.properties file is located under my WEB-INF directory

3) this entry is in my web.xml file

 <context-param>
  <param-name>org.apache.velocity.properties</param-name>
  <param-value>/WEB-INF/velocity.properties</param-value>
 </context-param>
 

4) velocity.properties content is 

runtime.log = velocity.log
directive.foreach.counter.name = velociCount
directive.foreach.counter.initial.value = 0
resource.manager.logwhenfound = false
file.resource.loader.cache = true
file.resource.loader.modificationCheckInterval = 2
velocimacro.library.autoreload = false
velocimacro.permissions.allow.inline = true
velocimacro.permissions.allow.inline.to.replace.global = true

5) the velocity.log file is nowhere... Before I had it created under my Eclipse 
home directory (I'm running Tomcat from Eclipse with Sysdeo plugin).. No matter 
if I run Tomcat under Eclipse OR standalone the log is nowhere.

So, to clarify : with this setup, being under cactus or not, with Tomcat 
standalone or not I have no log at all...

Any help greatly appreciated ! 

Thank you in advance

 

protected ExtendedProperties loadConfiguration(ServletConfig config ) throws 
IOException, FileNotFoundException
    {
        ExtendedProperties  p = new ExtendedProperties ();
        
        // Obtiens la valeur de la propriété org.apache.velocity.properties
        // et charge le fichier .properties correspondant
        String propsFile = config.getInitParameter(INIT_PROPS_KEY);
        if(propsFile != null) 
        {
            java.io.InputStream iStream = 
getServletContext().getResourceAsStream(propsFile);

            if (iStream != null) 
              p.load( iStream );
            else
                System.out.println("prop file !!");
        }
        
        /*
         * Altération d'autre paramètres au runtime
         */

        String path = config.getServletContext().getRealPath("/");
        if (path == null)
        {
            System.out.println(" AnaemServlet.loadConfiguration() : unable to 
get the current webapp root.  Using '/'. Please fix !"); 
            path = "/";
        }
        p.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,  path);
        System.out.println("Velocity.FILE_RESOURCE_LOADER_PATH = " + path);
        p.setProperty("runtime.log", path + "velocity.log");

        return p;
    }

 

                
---------------------------------
 Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail

Reply via email to