After some research, I found that nvelocity
is being initialized using the SimpleLog4NetLogSystem
, the existing configuration (this is an old feature on the site) is telling nvelocity to use the NullLogSystem
. I think that's why the file is created empty and never modified, SimpleLog4NetLogSystem
is used at first but then the NullLogSystem
. I think it is some bug on this version.
Anyway I found how to change the configuration file, at least in the version we are using (1.0.3324.33234):
var props = new ExtendedProperties();
props.AddProperty("runtime.log", "Logs\\nvelocity.log");
Velocity.Init(props);
In later versions "runtime.log" is specified by the NVelocity.Runtime.RuntimeConstants.RUNTIME_LOG
constant.
Also the Velocity.Init can receive a configuration file so you don't have to hardcode the name of the log file.