You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Christian Müller (Closed JIRA)" <ji...@apache.org> on 2012/01/14 23:28:39 UTC
[jira] [Closed] (CAMEL-4884) Make velocity logging configurable
[ https://issues.apache.org/jira/browse/CAMEL-4884?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Müller closed CAMEL-4884.
-----------------------------------
Resolution: Fixed
> Make velocity logging configurable
> ----------------------------------
>
> Key: CAMEL-4884
> URL: https://issues.apache.org/jira/browse/CAMEL-4884
> Project: Camel
> Issue Type: Improvement
> Components: camel-velocity
> Reporter: Bobby Hargett
> Assignee: Christian Müller
> Labels: logging, velocity
> Fix For: 2.8.4, 2.9.1, 2.10.0
>
>
> Our team would like to have the velocity logging redirect to our logger, but this is not possible because it is hard coded into camel to use commons. I think the code should check to see if the logger has been set and if it has it should change it.
> Offending Code:
> VelocityEndpoint.getVelocityEngine
> if (ObjectHelper.isNotEmpty(getPropertiesFile())) {
> Resource resource = getResourceLoader().getResource(getPropertiesFile());
> InputStream reader = resource.getInputStream();
> properties.load(reader);
> log.info("Loaded the velocity configuration file " + getPropertiesFile());
> }
> // set the class resolver as a property so we can access it from CamelVelocityClasspathResourceLoader
> velocityEngine.addProperty("CamelClassResolver", getCamelContext().getClassResolver());
> // set regular properties
> properties.setProperty(Velocity.FILE_RESOURCE_LOADER_CACHE, isLoaderCache() ? "true" : "false");
> properties.setProperty(Velocity.RESOURCE_LOADER, "file, class");
> properties.setProperty("class.resource.loader.description", "Camel Velocity Classpath Resource Loader");
> properties.setProperty("class.resource.loader.class", CamelVelocityClasspathResourceLoader.class.getName());
> {color:red} *add a if test here?*{color}
> properties.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, CommonsLogLogChute.class.getName());
> properties.setProperty(CommonsLogLogChute.LOGCHUTE_COMMONS_LOG_NAME, VelocityEndpoint.class.getName());
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira