On 26 Nov 2007 at 5:02, ilcavero wrote:

> Had the exact same problem as here, this velocity.log on root thing is a
> common sight on appfuse projects.
> thankfully the VelocityTools project provides classes to easily configure
> this. I created the velocity.properties file and added just this line
> 
> runtime.log.logsystem.class=org.apache.velocity.tools.generic.log.CommonsLogLogSystem
> 
> I had to add the velocity-tools-generic dependency to my pom and now all
> velocity logging goes through my commons logging in tomcat.

For those of us like me who have difficulty in translating ilcavero's "expert-
level" instructions, I thought I'd detail exactly what I did to get Velocity 
logging to merge with all my other application logs.  I don't know enough 
about Appfuse yet to say if this is the "right" way, but it worked for me.

My application is based on AppFuse 2.0 + the Struts2 Archetype.

1.      I located the root-level <dependencies> tag in my pom.xml, near the 
bottom of the file.  This tag contains the appfuse <type>war</type> and 
<type>warpath</type>, among others.  At the end of the list of dependencies 
inside this tag (after the <dependency> containing 
<groupId>org.subethamail</groupId> ), I added the following:

                <dependency>
                        <groupId>velocity-tools</groupId>
                        <artifactId>velocity-tools-generic</artifactId>
                        <version>${velocity.tools.version}</version>
                </dependency>

2.      I then located the root-level <properties> tag (the last root-level tag 
in my pom.xml) and within that, added the following:

        <velocity.tools.version>1.2</velocity.tools.version>

        I don't think it matters where you put this inside the <properties> 
tag, 
but I thought it seemed to fit logically under the comment:

                <!-- Framework dependency versions -->

        so I put it there (after the <appfuse.version> and <spring.version> 
tags).

Hope this saves someone else the time it took me to work this out.

Cheers,
Rob Hills
Waikiki, Western Australia
Mobile +61 (412) 904-357
Fax: +61 (8) 9529-2137

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

Reply via email to