velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Byron Foster <by...@base2.cc>
Subject Re: Velocity Logging
Date Tue, 07 Oct 2008 21:29:02 GMT
Mark Fenbers wrote:
> Thanks!  Your info was quite helpful and I was able to read in the
> file (finally!) using Velocity.init() -- as you show below, but when
> I used Velocity.setProperty() to set the "runtime.log" as you have
> shown below, it gets ignored.

If you use setProperty() make sure you do it AFTER the init(), because 
init will wipe out any previous setProperties(), this may be the problem.

> If I remove the runtime.log entry in
> the properties file, then the default log is used instead
> (./velocity.log).

I don't follow here because ./velocity.log is the default log, you seem 
to refer to a different default log.

>  What I wish is to use a different velocity log
> file for each user (as different users will use separate instances of
> my software concurrently).  My software is a standalone GUI
> application written in Java 5, not a web app.  How can I specify a
> log file name (determined at run-time) if the setProperty() method
> does not work??

Sounds like your intent is to set runtime.log each time you process a 
velocity template for a given user.  Someone more familiar with the 
Velocity log system could provide more info, but I believe that this 
will mean Velocity will need to be re-initialized for each log switch, 
if this even works.  If efficiency is an issue you probably don't want 
to use this solution, but maybe create a custom Velocity LogChute:

http://velocity.apache.org/engine/releases/velocity-1.5/developer-guide.html#simpleexampleofacustomlogger

Or maybe a logging package like Log4J or the java logging facility has 
an appender that does what you need.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message