Question

I have a webapp that uses velocity for logging. The velocity.properties file has 2 lines:

runtime.log = ${solr.config}/../logs/browse.log
runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem

solr.config is a property defined in the webapp. When the webapp is built, ${solr.config} is updated to the property value.

Is it possible to "remodel" solr.config as a system property (thus allowing me set the log file dir at runtime)? E.g. lets call prop solr.config.sys, is it possible for the runtime env to work out the following:

runtime.log=${solr.config.sys}/logs/preview.log

, as my testing so far shows that velocity looks for "${solr.config.sys}/logs/preview.log" and does not attempt to replace system property. I did something similar before in log4j using a system property to define the logging directory.

Thanks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top