Disable velocity logging in production?

Hi,
I’m pretty new to Camunda. I have an email task setup with velocity that works fine locally, but outputs this error in production.

Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.

I think it’s because velocity is trying to create a log file, but can’t due to our permissions. Is there a way to disable logging for the velocity engine?

@dzou422 When we run this code locally, it works properly because where you have sufficient permissions.

VelocityEngine ve = new VelocityEngine();
ve.init();

When the application is to be deployed on a highly secure system where permissions are not very easy to grant. In such a system you might get this error.

With all the default settings, Velocity tries to write a log file named velocity.log in the same directory from where tomcat server is started. In case where the tomcat server is not started from /tomcat/server/bin and you choose a different folder where you don’t have write permissions you get this error.

You can replace the initialization part of Velocity with the following code:

VelocityEngine ve = new VelocityEngine();
ve.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,"org.apache.velocity.runtime.log.Log4JLogChute" );
ve.setProperty("runtime.log.logsystem.log4j.logger",LOGGER_NAME);
ve.init();
		
StringWriter w = new StringWriter();
InputStream instream = EmailClient.class.getResourceAsStream("/"+templateName);

// Make a Context
VelocityContext context = new VelocityContext();

Velocity.evaluate(context, w, "Velocity", getStringFromInputStream(instream));

Hi I’ve written this bean, but it looks like the log file is still being created, is it because the velocity dependency is being called indirectly through camunda’s dependency:
org.camunda.template-engines
camunda-template-engines-velocity
1.0.0

My bean: