Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4884

Make velocity logging configurable

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      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());
      add a if test here?
      properties.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, CommonsLogLogChute.class.getName());
      properties.setProperty(CommonsLogLogChute.LOGCHUTE_COMMONS_LOG_NAME, VelocityEndpoint.class.getName());

      Attachments

        Activity

          People

            muellerc Christian Müller
            bhargett Bobby Hargett
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: