Wednesday, 10 November 2010

velocity.log Permission denied

(within JadaSite 2.03 using Apache Valocity 1.5)

I got a lot of Permission denied stacktraces for velocity.log within my catalina.out. It is not big problem for now, but these messages could lead to large catalina.log file which will effect performances of Web application.

Velocity's log file is written into current folder (for me /etc/init.d) by default setup. If tomcat user does not have the right to create that file, you'll get Permission denied error. According to the Apache's documentation, Velocity's setup can be changed within Java. But, I didn't like the idea of changing Jada's code just for that.

Instead, I have overridden Velocity default properties:

  • I got the original file from
    velocity-1.5.jar (in folder org/apache/velocity/runtime/defaults/)
  • I created new directories within Jada's WEB-INF/classes folder to have the same structure
  • I created a new file within just created folder
  • In that new file, I put the contents from the original file, and changed the value in the line 32 to
    runtime.log = /tmp/velocity.log

Edit: Within this velocity log I got an error saying that class org.apache.log.format.Formatter is not found. The class can be found in avalon-logkit-2.2.1.jar (or any newer version I suppose). To fix this, download this jar and add it to the class path (I've put it in Jada's WEB-INF/lib/ folder).


Slune said...

Thank you very much. It helped me a lot.

Slune said...

I added this in to the

Kris said...

Event better with Log4J. Thanks

Check the following text - it might help to make event more precise setup:

Popular Posts