Stack Exchange
Apache Velocity standard logging configuration creates far too much log output
I have a small web Page Project I have templated with velocity
My web.xml configuration is pretty simple
<servlet>
  <servlet-name>velocity</servlet-name>
  <servlet-class>org.apache.velocity.tools.view.VelocityViewServlet</servlet-class>
</servlet>
<init-param>
  <param-name>org.apache.velocity.properties</param-name>
  <param-value>/WEB-INF/velocity.properties</param-value>
</init-param>
<servlet-mapping>
  <servlet-name>velocity</servlet-name>
  <url-pattern>*.html</url-pattern>
</servlet-mapping>

My Log is full with this kind of logging from org.apache.catalina.core.ApplicationContext
Nov 06, 2014 4:25:24 PM org.apache.catalina.core.ApplicationContext log
INFORMATION:  Velocity   [info] WebappResourceLoader: added template path - '/WEB-INF/velocity/'
Nov 06, 2014 4:25:24 PM org.apache.catalina.core.ApplicationContext log
INFORMATION:  Velocity  [trace] WebappResourceLoader: initialization complete.
Nov 06, 2014 4:25:24 PM org.apache.catalina.core.ApplicationContext log
INFORMATION:  Velocity  [debug] ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.StringResourceLoader

The Log entrances always look like:
'date' PM org.apache.catalina.core.ApplicationContext log
INFORMATION:  Velocity 'some pretty useless information'.
I have standard tomcat Configuration and would like to avoid changing something on tomcat level. Still don't know what to do with pretty useless 60 MB Log files per day.
Is there a way to reduce the amount of logs? I know the velocity documentation on logging velocity logging and I find it a little bit confusing.
Any help will be appreciated…

The Claude Brisson Answer is probably correct if you are using log4j in your application. The Last part helped me the most.
I am using commons-logging-1.1.jar as in the examples of the velocity project. So adding just this 2 lines of configuration to /WEB-INF/velocity.properties was the solution:
runtime.log.logsystem.class = org.apache.velocity.runtime.log.ServletLogChute
runtime.log.logsystem.servlet.level = info


The extra line is from tomcat, so you would see it with any webapp, and you won't be able to remove it without touching tomcat configuration. It's not straightforward, but it's not that hard. See for instance how to set up log4j logging (this page is for tomcat 7, but please adapt if it's not your tomcat version). In a nutshell:

download log4j 1.2+ jar from log4j download page and put it in tomcat/lib
download tomcat-juli-adapters.jar and log4j's tomcat-juli.jar from the extras section of tomcat 7 download page. tomcat-juli.jar goes in tomcat/bin and tomcat-juli-adapters.jar goes in tomcat/lib.
you must now set up a tomcat/lib/log4j.properties file. There are several examples around, here's one that logs all webapps in a daily-rotated tomcat/logs/tomcat.log file:
log4j.rootCategory=info, rotating
log4j.appender.rotating=org.apache.log4j.DailyRollingFileAppender
log4j.appender.rotating.File=${catalina.home}/logs/tomcat.log 
log4j.appender.rotating.DatePattern='.'yyyy-MM-dd
log4j.appender.rotating.layout=org.apache.log4j.PatternLayout
log4j.appender.rotating.layout.ConversionPattern=%d - %m%n

Once you got rid of this extra line, then you can set up Velocity log level. Here's the relevant portion of /WEB-INF/velocity.properties:
runtime.log.logsystem.class = org.apache.velocity.runtime.log.ServletLogChute
runtime.log.logsystem.servlet.level = info


For the moment tomcat can't find log4j.properties in the lib directory but i am still working on it...

Be sure to regularly check catalina.out for errors.
