Velocity log

OK, this patch seems to do the trick for me. DHIS has suddenly become very quiet.

There are some bad things about this patch, namely that velocity is init-ed in two places…VelocityManager and GridUtils. I did not want to start to refactor GridUtils, so I basically put the same code in two places. Seems like something else to be cleaned up, but I did not want to get into it. I have added the velocity.properties file, through which you should be able to specify the logging mechanism. Also, the default velocity logger is set to org.apache.velocity.runtime.log.NullLogSystem unless DEBUG logging is turned on. I have not tested whether the debugging actually works, but maybe the points I wanted are clear, and someone can clean the rest up as it should be.

Cheers,
Jason

velocity_logging_cleanup.patch (6.33 KB)

···

On Sat, Oct 29, 2011 at 10:47 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Jason appreciate the investigation you are doing here. I think it’s

important that we handle these things well.

On 29 October 2011 20:18, Jason Pickering jason.p.pickering@gmail.com wrote:

I agree, it is a minor issue. It is just annoying when trawling through logs

to see all this stuff which seemingly we have no use for, and no control

over (especially in production environments)

The diff I sent, along with the addition of a velocity.properties file in

WEB-INF/classes with content

runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem

runtime.log.logsystem.log4j.category=velocity

stops the initial error from happening as well as the other error I detailed

in the log.

I will prepare a patch and send to Lars/Jo/Bob for consideration.

Regards,

Jason

On Sat, Oct 29, 2011 at 8:00 PM, Jo Størset storset@gmail.com wrote:

hi,

the velocity manager is a new addition used in places where we use

velocity on our own, and as you show is prbably easy enough to fix. It will

probably be a bit more cumbersome to override struts’ initalization of

velocity, and I’m not sure it is worth the effort…

Jo