impossible de configurer Velocity pour logguer
Bonjour,
Ca fait deja un bon moment que je me bats avec ce problème.
Dans une appli en standalone, j'utilise spring et velocity.
dans mon applicationContext.xml je mets ceci pour configurer velocity :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
<!-- resources loader path indique ou trouver les template velocity -->
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="resourceLoaderPath" value="classpath:templates" />
<!-- ne marche pas, si besoin mettre les properties ici.
<property name="configLocation" value="/conf/velocity.properties" /> -->
<property name="velocityProperties">
<props>
<prop key="runtime.log.logsystem.class">org.apache.velocity.runtime.log.Log4JLogChute</prop>
<prop key="runtime.log">N:\log\velocityxx.log</prop>
</props>
</property>
</bean> |
J'ai un main qui instancie le bean velocityEngine :
Code:
1 2 3 4 5
|
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("conf/applicationContext.xml");
VelocityEngine ve = (VelocityEngine) ctx.getBean("velocityEngine"); |
J'ai un log4j.properties
Code:
1 2 3 4 5 6 7 8
|
log4j.rootLogger=debug, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.SimpleLayout
#log4j.logger.org.apache.velocity=DEBUG |
Mais le fichier log n'est pas créé.
J'utilise velocity 1.6 et spring 2.5
Merci pour votre aide.