似乎很直接.http://velocity.apache.org/engine/devel/developer-guide.html#Configuring_Logging上的文档 说明要设置runtime.log属性.这是我所有物业的所得.
velocityEngine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templatesPath);
velocityEngine.setProperty("runtime.log", "/path/to/my/file/velocity.log");
velocityEngine.setProperty("resource.loader", "string");
velocityEngine.setProperty("string.resource.loader.class", "org.apache.velocity.runtime.resource.loader.StringResourceLoader");
velocityEngine.setProperty("string.resource.loader.repository.class", "org.apache.velocity.runtime.resource.util.StringResourceRepositoryImpl");
Run Code Online (Sandbox Code Playgroud)
没有找到我告诉它放置它的任何日志文件,而是找到旧的(初始化文件夹)位置的新错误.有任何想法吗?:d